3 #define PY_SSIZE_T_CLEAN 6 #error Python headers needed to compile C extensions, please install development version of Python. 7 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) 8 #error Cython requires Python 2.6+ or Python 3.3+. 10 #define CYTHON_ABI "0_29_16" 11 #define CYTHON_HEX_VERSION 0x001D10F0 12 #define CYTHON_FUTURE_DIVISION 0 15 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) 17 #if !defined(WIN32) && !defined(MS_WINDOWS) 29 #define DL_IMPORT(t) t 32 #define DL_EXPORT(t) t 35 #ifndef HAVE_LONG_LONG 36 #if PY_VERSION_HEX >= 0x02070000 37 #define HAVE_LONG_LONG 41 #define PY_LONG_LONG LONG_LONG 44 #define Py_HUGE_VAL HUGE_VAL 47 #define CYTHON_COMPILING_IN_PYPY 1 48 #define CYTHON_COMPILING_IN_PYSTON 0 49 #define CYTHON_COMPILING_IN_CPYTHON 0 50 #undef CYTHON_USE_TYPE_SLOTS 51 #define CYTHON_USE_TYPE_SLOTS 0 52 #undef CYTHON_USE_PYTYPE_LOOKUP 53 #define CYTHON_USE_PYTYPE_LOOKUP 0 54 #if PY_VERSION_HEX < 0x03050000 55 #undef CYTHON_USE_ASYNC_SLOTS 56 #define CYTHON_USE_ASYNC_SLOTS 0 57 #elif !defined(CYTHON_USE_ASYNC_SLOTS) 58 #define CYTHON_USE_ASYNC_SLOTS 1 60 #undef CYTHON_USE_PYLIST_INTERNALS 61 #define CYTHON_USE_PYLIST_INTERNALS 0 62 #undef CYTHON_USE_UNICODE_INTERNALS 63 #define CYTHON_USE_UNICODE_INTERNALS 0 64 #undef CYTHON_USE_UNICODE_WRITER 65 #define CYTHON_USE_UNICODE_WRITER 0 66 #undef CYTHON_USE_PYLONG_INTERNALS 67 #define CYTHON_USE_PYLONG_INTERNALS 0 68 #undef CYTHON_AVOID_BORROWED_REFS 69 #define CYTHON_AVOID_BORROWED_REFS 1 70 #undef CYTHON_ASSUME_SAFE_MACROS 71 #define CYTHON_ASSUME_SAFE_MACROS 0 72 #undef CYTHON_UNPACK_METHODS 73 #define CYTHON_UNPACK_METHODS 0 74 #undef CYTHON_FAST_THREAD_STATE 75 #define CYTHON_FAST_THREAD_STATE 0 76 #undef CYTHON_FAST_PYCALL 77 #define CYTHON_FAST_PYCALL 0 78 #undef CYTHON_PEP489_MULTI_PHASE_INIT 79 #define CYTHON_PEP489_MULTI_PHASE_INIT 0 80 #undef CYTHON_USE_TP_FINALIZE 81 #define CYTHON_USE_TP_FINALIZE 0 82 #undef CYTHON_USE_DICT_VERSIONS 83 #define CYTHON_USE_DICT_VERSIONS 0 84 #undef CYTHON_USE_EXC_INFO_STACK 85 #define CYTHON_USE_EXC_INFO_STACK 0 86 #elif defined(PYSTON_VERSION) 87 #define CYTHON_COMPILING_IN_PYPY 0 88 #define CYTHON_COMPILING_IN_PYSTON 1 89 #define CYTHON_COMPILING_IN_CPYTHON 0 90 #ifndef CYTHON_USE_TYPE_SLOTS 91 #define CYTHON_USE_TYPE_SLOTS 1 93 #undef CYTHON_USE_PYTYPE_LOOKUP 94 #define CYTHON_USE_PYTYPE_LOOKUP 0 95 #undef CYTHON_USE_ASYNC_SLOTS 96 #define CYTHON_USE_ASYNC_SLOTS 0 97 #undef CYTHON_USE_PYLIST_INTERNALS 98 #define CYTHON_USE_PYLIST_INTERNALS 0 99 #ifndef CYTHON_USE_UNICODE_INTERNALS 100 #define CYTHON_USE_UNICODE_INTERNALS 1 102 #undef CYTHON_USE_UNICODE_WRITER 103 #define CYTHON_USE_UNICODE_WRITER 0 104 #undef CYTHON_USE_PYLONG_INTERNALS 105 #define CYTHON_USE_PYLONG_INTERNALS 0 106 #ifndef CYTHON_AVOID_BORROWED_REFS 107 #define CYTHON_AVOID_BORROWED_REFS 0 109 #ifndef CYTHON_ASSUME_SAFE_MACROS 110 #define CYTHON_ASSUME_SAFE_MACROS 1 112 #ifndef CYTHON_UNPACK_METHODS 113 #define CYTHON_UNPACK_METHODS 1 115 #undef CYTHON_FAST_THREAD_STATE 116 #define CYTHON_FAST_THREAD_STATE 0 117 #undef CYTHON_FAST_PYCALL 118 #define CYTHON_FAST_PYCALL 0 119 #undef CYTHON_PEP489_MULTI_PHASE_INIT 120 #define CYTHON_PEP489_MULTI_PHASE_INIT 0 121 #undef CYTHON_USE_TP_FINALIZE 122 #define CYTHON_USE_TP_FINALIZE 0 123 #undef CYTHON_USE_DICT_VERSIONS 124 #define CYTHON_USE_DICT_VERSIONS 0 125 #undef CYTHON_USE_EXC_INFO_STACK 126 #define CYTHON_USE_EXC_INFO_STACK 0 128 #define CYTHON_COMPILING_IN_PYPY 0 129 #define CYTHON_COMPILING_IN_PYSTON 0 130 #define CYTHON_COMPILING_IN_CPYTHON 1 131 #ifndef CYTHON_USE_TYPE_SLOTS 132 #define CYTHON_USE_TYPE_SLOTS 1 134 #if PY_VERSION_HEX < 0x02070000 135 #undef CYTHON_USE_PYTYPE_LOOKUP 136 #define CYTHON_USE_PYTYPE_LOOKUP 0 137 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) 138 #define CYTHON_USE_PYTYPE_LOOKUP 1 140 #if PY_MAJOR_VERSION < 3 141 #undef CYTHON_USE_ASYNC_SLOTS 142 #define CYTHON_USE_ASYNC_SLOTS 0 143 #elif !defined(CYTHON_USE_ASYNC_SLOTS) 144 #define CYTHON_USE_ASYNC_SLOTS 1 146 #if PY_VERSION_HEX < 0x02070000 147 #undef CYTHON_USE_PYLONG_INTERNALS 148 #define CYTHON_USE_PYLONG_INTERNALS 0 149 #elif !defined(CYTHON_USE_PYLONG_INTERNALS) 150 #define CYTHON_USE_PYLONG_INTERNALS 1 152 #ifndef CYTHON_USE_PYLIST_INTERNALS 153 #define CYTHON_USE_PYLIST_INTERNALS 1 155 #ifndef CYTHON_USE_UNICODE_INTERNALS 156 #define CYTHON_USE_UNICODE_INTERNALS 1 158 #if PY_VERSION_HEX < 0x030300F0 159 #undef CYTHON_USE_UNICODE_WRITER 160 #define CYTHON_USE_UNICODE_WRITER 0 161 #elif !defined(CYTHON_USE_UNICODE_WRITER) 162 #define CYTHON_USE_UNICODE_WRITER 1 164 #ifndef CYTHON_AVOID_BORROWED_REFS 165 #define CYTHON_AVOID_BORROWED_REFS 0 167 #ifndef CYTHON_ASSUME_SAFE_MACROS 168 #define CYTHON_ASSUME_SAFE_MACROS 1 170 #ifndef CYTHON_UNPACK_METHODS 171 #define CYTHON_UNPACK_METHODS 1 173 #ifndef CYTHON_FAST_THREAD_STATE 174 #define CYTHON_FAST_THREAD_STATE 1 176 #ifndef CYTHON_FAST_PYCALL 177 #define CYTHON_FAST_PYCALL 1 179 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT 180 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) 182 #ifndef CYTHON_USE_TP_FINALIZE 183 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) 185 #ifndef CYTHON_USE_DICT_VERSIONS 186 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) 188 #ifndef CYTHON_USE_EXC_INFO_STACK 189 #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) 192 #if !defined(CYTHON_FAST_PYCCALL) 193 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) 195 #if CYTHON_USE_PYLONG_INTERNALS 196 #include "longintrepr.h" 201 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P ==
sizeof(
void*)) };
204 #ifndef __has_attribute 205 #define __has_attribute(x) 0 207 #ifndef __has_cpp_attribute 208 #define __has_cpp_attribute(x) 0 210 #ifndef CYTHON_RESTRICT 211 #if defined(__GNUC__) 212 #define CYTHON_RESTRICT __restrict__ 213 #elif defined(_MSC_VER) && _MSC_VER >= 1400 214 #define CYTHON_RESTRICT __restrict 215 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 216 #define CYTHON_RESTRICT restrict 218 #define CYTHON_RESTRICT 221 #ifndef CYTHON_UNUSED 222 # if defined(__GNUC__) 223 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) 224 # define CYTHON_UNUSED __attribute__ ((__unused__)) 226 # define CYTHON_UNUSED 228 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) 229 # define CYTHON_UNUSED __attribute__ ((__unused__)) 231 # define CYTHON_UNUSED 234 #ifndef CYTHON_MAYBE_UNUSED_VAR 235 # if defined(__cplusplus) 236 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
238 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) 241 #ifndef CYTHON_NCP_UNUSED 242 # if CYTHON_COMPILING_IN_CPYTHON 243 # define CYTHON_NCP_UNUSED 245 # define CYTHON_NCP_UNUSED CYTHON_UNUSED 248 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) 250 #ifndef _MSC_STDINT_H_ 252 typedef unsigned char uint8_t;
253 typedef unsigned int uint32_t;
255 typedef unsigned __int8 uint8_t;
256 typedef unsigned __int32 uint32_t;
262 #ifndef CYTHON_FALLTHROUGH 263 #if defined(__cplusplus) && __cplusplus >= 201103L 264 #if __has_cpp_attribute(fallthrough) 265 #define CYTHON_FALLTHROUGH [[fallthrough]] 266 #elif __has_cpp_attribute(clang::fallthrough) 267 #define CYTHON_FALLTHROUGH [[clang::fallthrough]] 268 #elif __has_cpp_attribute(gnu::fallthrough) 269 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] 272 #ifndef CYTHON_FALLTHROUGH 273 #if __has_attribute(fallthrough) 274 #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) 276 #define CYTHON_FALLTHROUGH 279 #if defined(__clang__ ) && defined(__apple_build_version__) 280 #if __apple_build_version__ < 7000000 281 #undef CYTHON_FALLTHROUGH 282 #define CYTHON_FALLTHROUGH 287 #ifndef CYTHON_INLINE 288 #if defined(__clang__) 289 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) 290 #elif defined(__GNUC__) 291 #define CYTHON_INLINE __inline__ 292 #elif defined(_MSC_VER) 293 #define CYTHON_INLINE __inline 294 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 295 #define CYTHON_INLINE inline 297 #define CYTHON_INLINE 301 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) 302 #define Py_OptimizeFlag 0 304 #define __PYX_BUILD_PY_SSIZE_T "n" 305 #define CYTHON_FORMAT_SSIZE_T "z" 306 #if PY_MAJOR_VERSION < 3 307 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" 308 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ 309 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) 310 #define __Pyx_DefaultClassType PyClass_Type 312 #define __Pyx_BUILTIN_MODULE_NAME "builtins" 313 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2 314 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ 315 PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) 317 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ 318 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) 320 #define __Pyx_DefaultClassType PyType_Type 322 #ifndef Py_TPFLAGS_CHECKTYPES 323 #define Py_TPFLAGS_CHECKTYPES 0 325 #ifndef Py_TPFLAGS_HAVE_INDEX 326 #define Py_TPFLAGS_HAVE_INDEX 0 328 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER 329 #define Py_TPFLAGS_HAVE_NEWBUFFER 0 331 #ifndef Py_TPFLAGS_HAVE_FINALIZE 332 #define Py_TPFLAGS_HAVE_FINALIZE 0 334 #ifndef METH_STACKLESS 335 #define METH_STACKLESS 0 337 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) 338 #ifndef METH_FASTCALL 339 #define METH_FASTCALL 0x80 341 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject *
const *args, Py_ssize_t nargs);
342 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *
self, PyObject *
const *args,
343 Py_ssize_t nargs, PyObject *kwnames);
345 #define __Pyx_PyCFunctionFast _PyCFunctionFast 346 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords 348 #if CYTHON_FAST_PYCCALL 349 #define __Pyx_PyFastCFunction_Check(func)\ 350 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) 352 #define __Pyx_PyFastCFunction_Check(func) 0 354 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) 355 #define PyObject_Malloc(s) PyMem_Malloc(s) 356 #define PyObject_Free(p) PyMem_Free(p) 357 #define PyObject_Realloc(p) PyMem_Realloc(p) 359 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 360 #define PyMem_RawMalloc(n) PyMem_Malloc(n) 361 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) 362 #define PyMem_RawFree(p) PyMem_Free(p) 364 #if CYTHON_COMPILING_IN_PYSTON 365 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) 366 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) 368 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) 369 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) 371 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 372 #define __Pyx_PyThreadState_Current PyThreadState_GET() 373 #elif PY_VERSION_HEX >= 0x03060000 374 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() 375 #elif PY_VERSION_HEX >= 0x03000000 376 #define __Pyx_PyThreadState_Current PyThreadState_GET() 378 #define __Pyx_PyThreadState_Current _PyThreadState_Current 380 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) 381 #include "pythread.h" 382 #define Py_tss_NEEDS_INIT 0 383 typedef int Py_tss_t;
384 static CYTHON_INLINE
int PyThread_tss_create(Py_tss_t *key) {
385 *key = PyThread_create_key();
388 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(
void) {
389 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(
sizeof(Py_tss_t));
390 *key = Py_tss_NEEDS_INIT;
393 static CYTHON_INLINE
void PyThread_tss_free(Py_tss_t *key) {
396 static CYTHON_INLINE
int PyThread_tss_is_created(Py_tss_t *key) {
397 return *key != Py_tss_NEEDS_INIT;
399 static CYTHON_INLINE
void PyThread_tss_delete(Py_tss_t *key) {
400 PyThread_delete_key(*key);
401 *key = Py_tss_NEEDS_INIT;
403 static CYTHON_INLINE
int PyThread_tss_set(Py_tss_t *key,
void *value) {
404 return PyThread_set_key_value(*key, value);
406 static CYTHON_INLINE
void * PyThread_tss_get(Py_tss_t *key) {
407 return PyThread_get_key_value(*key);
410 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) 411 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) 413 #define __Pyx_PyDict_NewPresized(n) PyDict_New() 415 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION 416 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) 417 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) 419 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) 420 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) 422 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS 423 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) 425 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) 427 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) 428 #define CYTHON_PEP393_ENABLED 1 429 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 430 0 : _PyUnicode_Ready((PyObject *)(op))) 431 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) 432 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) 433 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) 434 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) 435 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) 436 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) 437 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) 438 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) 440 #define CYTHON_PEP393_ENABLED 0 441 #define PyUnicode_1BYTE_KIND 1 442 #define PyUnicode_2BYTE_KIND 2 443 #define PyUnicode_4BYTE_KIND 4 444 #define __Pyx_PyUnicode_READY(op) (0) 445 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) 446 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) 447 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) 448 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) 449 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) 450 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) 451 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) 452 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) 454 #if CYTHON_COMPILING_IN_PYPY 455 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) 456 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) 458 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) 459 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ 460 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) 462 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) 463 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) 465 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) 466 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) 468 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) 469 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) 471 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) 472 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) 473 #if PY_MAJOR_VERSION >= 3 474 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) 476 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) 478 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) 479 #define PyObject_ASCII(o) PyObject_Repr(o) 481 #if PY_MAJOR_VERSION >= 3 482 #define PyBaseString_Type PyUnicode_Type 483 #define PyStringObject PyUnicodeObject 484 #define PyString_Type PyUnicode_Type 485 #define PyString_Check PyUnicode_Check 486 #define PyString_CheckExact PyUnicode_CheckExact 487 #ifndef PyObject_Unicode 488 #define PyObject_Unicode PyObject_Str 491 #if PY_MAJOR_VERSION >= 3 492 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) 493 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) 495 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) 496 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) 498 #ifndef PySet_CheckExact 499 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) 501 #if CYTHON_ASSUME_SAFE_MACROS 502 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) 504 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) 506 #if PY_MAJOR_VERSION >= 3 507 #define PyIntObject PyLongObject 508 #define PyInt_Type PyLong_Type 509 #define PyInt_Check(op) PyLong_Check(op) 510 #define PyInt_CheckExact(op) PyLong_CheckExact(op) 511 #define PyInt_FromString PyLong_FromString 512 #define PyInt_FromUnicode PyLong_FromUnicode 513 #define PyInt_FromLong PyLong_FromLong 514 #define PyInt_FromSize_t PyLong_FromSize_t 515 #define PyInt_FromSsize_t PyLong_FromSsize_t 516 #define PyInt_AsLong PyLong_AsLong 517 #define PyInt_AS_LONG PyLong_AS_LONG 518 #define PyInt_AsSsize_t PyLong_AsSsize_t 519 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask 520 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask 521 #define PyNumber_Int PyNumber_Long 523 #if PY_MAJOR_VERSION >= 3 524 #define PyBoolObject PyLongObject 526 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY 527 #ifndef PyUnicode_InternFromString 528 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) 531 #if PY_VERSION_HEX < 0x030200A4 532 typedef long Py_hash_t;
533 #define __Pyx_PyInt_FromHash_t PyInt_FromLong 534 #define __Pyx_PyInt_AsHash_t PyInt_AsLong 536 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t 537 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t 539 #if PY_MAJOR_VERSION >= 3 540 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) 542 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) 544 #if CYTHON_USE_ASYNC_SLOTS 545 #if PY_VERSION_HEX >= 0x030500B1 546 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods 547 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) 549 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) 552 #define __Pyx_PyType_AsAsync(obj) NULL 554 #ifndef __Pyx_PyAsyncMethodsStruct 559 } __Pyx_PyAsyncMethodsStruct;
562 #if defined(WIN32) || defined(MS_WINDOWS) 563 #define _USE_MATH_DEFINES 567 #define __PYX_NAN() ((float) NAN) 569 static CYTHON_INLINE
float __PYX_NAN() {
571 memset(&value, 0xFF,
sizeof(value));
575 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) 576 #define __Pyx_truncl trunc 578 #define __Pyx_truncl truncl 582 #define __PYX_ERR(f_index, lineno, Ln_error) \ 584 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ 587 #ifndef __PYX_EXTERN_C 589 #define __PYX_EXTERN_C extern "C" 591 #define __PYX_EXTERN_C extern 595 #define __PYX_HAVE__csmoothers 596 #define __PYX_HAVE_API__csmoothers 600 #include "numpy/arrayobject.h" 601 #include "numpy/ufuncobject.h" 604 #include "pythread.h" 611 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) 612 #define CYTHON_WITHOUT_ASSERTIONS 615 typedef struct {PyObject **p;
const char *
s;
const Py_ssize_t
n;
const char* encoding;
616 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
618 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 619 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 620 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) 621 #define __PYX_DEFAULT_STRING_ENCODING "" 622 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString 623 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize 624 #define __Pyx_uchar_cast(c) ((unsigned char)c) 625 #define __Pyx_long_cast(x) ((long)x) 626 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ 627 (sizeof(type) < sizeof(Py_ssize_t)) ||\ 628 (sizeof(type) > sizeof(Py_ssize_t) &&\ 629 likely(v < (type)PY_SSIZE_T_MAX ||\ 630 v == (type)PY_SSIZE_T_MAX) &&\ 631 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ 632 v == (type)PY_SSIZE_T_MIN))) ||\ 633 (sizeof(type) == sizeof(Py_ssize_t) &&\ 634 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ 635 v == (type)PY_SSIZE_T_MAX))) ) 636 static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
637 return (
size_t) i < (size_t) limit;
639 #if defined (__cplusplus) && __cplusplus >= 201103L 641 #define __Pyx_sst_abs(value) std::abs(value) 642 #elif SIZEOF_INT >= SIZEOF_SIZE_T 643 #define __Pyx_sst_abs(value) abs(value) 644 #elif SIZEOF_LONG >= SIZEOF_SIZE_T 645 #define __Pyx_sst_abs(value) labs(value) 646 #elif defined (_MSC_VER) 647 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) 648 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 649 #define __Pyx_sst_abs(value) llabs(value) 650 #elif defined (__GNUC__) 651 #define __Pyx_sst_abs(value) __builtin_llabs(value) 653 #define __Pyx_sst_abs(value) ((value<0) ? -value : value) 655 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
656 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
657 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) 658 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) 659 #define __Pyx_PyBytes_FromString PyBytes_FromString 660 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize 661 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
662 #if PY_MAJOR_VERSION < 3 663 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString 664 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize 666 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString 667 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize 669 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) 670 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) 671 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) 672 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) 673 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) 674 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) 675 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) 676 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) 677 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) 678 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) 679 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) 680 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) 681 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) 682 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) 683 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) 684 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) 685 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *
u) {
686 const Py_UNICODE *u_end =
u;
688 return (
size_t)(u_end - u - 1);
690 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) 691 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode 692 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode 693 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) 694 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) 695 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
696 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
697 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
698 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
699 #define __Pyx_PySequence_Tuple(obj)\ 700 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) 701 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
702 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
703 #if CYTHON_ASSUME_SAFE_MACROS 704 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) 706 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) 708 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) 709 #if PY_MAJOR_VERSION >= 3 710 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) 712 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) 714 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) 715 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 716 static int __Pyx_sys_getdefaultencoding_not_ascii;
717 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
719 PyObject* default_encoding = NULL;
720 PyObject* ascii_chars_u = NULL;
721 PyObject* ascii_chars_b = NULL;
722 const char* default_encoding_c;
723 sys = PyImport_ImportModule(
"sys");
725 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
727 if (!default_encoding)
goto bad;
728 default_encoding_c = PyBytes_AsString(default_encoding);
729 if (!default_encoding_c)
goto bad;
730 if (strcmp(default_encoding_c,
"ascii") == 0) {
731 __Pyx_sys_getdefaultencoding_not_ascii = 0;
733 char ascii_chars[128];
735 for (c = 0; c < 128; c++) {
738 __Pyx_sys_getdefaultencoding_not_ascii = 1;
739 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
740 if (!ascii_chars_u)
goto bad;
741 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
742 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
745 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
749 Py_DECREF(ascii_chars_u);
750 Py_DECREF(ascii_chars_b);
752 Py_DECREF(default_encoding);
755 Py_XDECREF(default_encoding);
756 Py_XDECREF(ascii_chars_u);
757 Py_XDECREF(ascii_chars_b);
761 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 762 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) 764 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) 765 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 766 static char* __PYX_DEFAULT_STRING_ENCODING;
767 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
769 PyObject* default_encoding = NULL;
770 char* default_encoding_c;
771 sys = PyImport_ImportModule(
"sys");
773 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
775 if (!default_encoding)
goto bad;
776 default_encoding_c = PyBytes_AsString(default_encoding);
777 if (!default_encoding_c)
goto bad;
778 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c) + 1);
779 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
780 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
781 Py_DECREF(default_encoding);
784 Py_XDECREF(default_encoding);
792 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) 793 #define likely(x) __builtin_expect(!!(x), 1) 794 #define unlikely(x) __builtin_expect(!!(x), 0) 796 #define likely(x) (x) 797 #define unlikely(x) (x) 799 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
801 static PyObject *__pyx_m = NULL;
802 static PyObject *__pyx_d;
803 static PyObject *__pyx_b;
804 static PyObject *__pyx_cython_runtime = NULL;
805 static PyObject *__pyx_empty_tuple;
806 static PyObject *__pyx_empty_bytes;
807 static PyObject *__pyx_empty_unicode;
808 static int __pyx_lineno;
809 static int __pyx_clineno = 0;
810 static const char * __pyx_cfilenm= __FILE__;
811 static const char *__pyx_filename;
814 #if !defined(CYTHON_CCOMPLEX) 815 #if defined(__cplusplus) 816 #define CYTHON_CCOMPLEX 1 817 #elif defined(_Complex_I) 818 #define CYTHON_CCOMPLEX 1 820 #define CYTHON_CCOMPLEX 0 830 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) 832 #define _Complex_I 1.0fj 836 static const char *__pyx_f[] = {
837 "proteus/csmoothers.pyx",
839 "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd",
840 "linux/lib/python3.7/site-packages/Cython/Includes/cpython/type.pxd",
841 "proteus/superluWrappers.pxd",
844 struct __pyx_memoryview_obj;
846 struct __pyx_memoryview_obj *memview;
849 Py_ssize_t strides[8];
850 Py_ssize_t suboffsets[8];
851 } __Pyx_memviewslice;
852 #define __Pyx_MemoryView_Len(m) (m.shape[0]) 855 #include <pythread.h> 856 #ifndef CYTHON_ATOMICS 857 #define CYTHON_ATOMICS 1 859 #define __pyx_atomic_int_type int 860 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\ 861 (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\ 863 #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1) 864 #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1) 865 #ifdef __PYX_DEBUG_ATOMICS 866 #warning "Using GNU atomics" 868 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0 870 #undef __pyx_atomic_int_type 871 #define __pyx_atomic_int_type LONG 872 #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value) 873 #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value) 874 #ifdef __PYX_DEBUG_ATOMICS 875 #pragma message ("Using MSVC atomics") 877 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0 878 #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value) 879 #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value) 880 #ifdef __PYX_DEBUG_ATOMICS 881 #warning "Using Intel atomics" 884 #undef CYTHON_ATOMICS 885 #define CYTHON_ATOMICS 0 886 #ifdef __PYX_DEBUG_ATOMICS 887 #warning "Not using atomics" 890 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
892 #define __pyx_add_acquisition_count(memview)\ 893 __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock) 894 #define __pyx_sub_acquisition_count(memview)\ 895 __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock) 897 #define __pyx_add_acquisition_count(memview)\ 898 __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) 899 #define __pyx_sub_acquisition_count(memview)\ 900 __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) 904 #ifndef __PYX_FORCE_INIT_THREADS 905 #define __PYX_FORCE_INIT_THREADS 0 909 #define __Pyx_PyGILState_Ensure PyGILState_Ensure 910 #define __Pyx_PyGILState_Release PyGILState_Release 911 #define __Pyx_FastGIL_Remember() 912 #define __Pyx_FastGIL_Forget() 913 #define __Pyx_FastGilFuncInit() 916 #define IS_UNSIGNED(type) (((type) -1) > 0) 917 struct __Pyx_StructField_;
918 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0) 921 struct __Pyx_StructField_* fields;
929 typedef struct __Pyx_StructField_ {
930 __Pyx_TypeInfo* type;
935 __Pyx_StructField* field;
936 size_t parent_offset;
937 } __Pyx_BufFmt_StackElem;
939 __Pyx_StructField root;
940 __Pyx_BufFmt_StackElem* head;
942 size_t new_count, enc_count;
943 size_t struct_alignment;
949 } __Pyx_BufFmt_Context;
959 typedef npy_int8 __pyx_t_5numpy_int8_t;
968 typedef npy_int16 __pyx_t_5numpy_int16_t;
977 typedef npy_int32 __pyx_t_5numpy_int32_t;
986 typedef npy_int64 __pyx_t_5numpy_int64_t;
995 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1004 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1013 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1022 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1031 typedef npy_float32 __pyx_t_5numpy_float32_t;
1040 typedef npy_float64 __pyx_t_5numpy_float64_t;
1049 typedef npy_long __pyx_t_5numpy_int_t;
1058 typedef npy_longlong __pyx_t_5numpy_long_t;
1067 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1076 typedef npy_ulong __pyx_t_5numpy_uint_t;
1085 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1094 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1103 typedef npy_intp __pyx_t_5numpy_intp_t;
1112 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1121 typedef npy_double __pyx_t_5numpy_float_t;
1130 typedef npy_double __pyx_t_5numpy_double_t;
1139 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1148 typedef int __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER;
1152 typedef ::std::complex< float > __pyx_t_float_complex;
1154 typedef float _Complex __pyx_t_float_complex;
1157 typedef struct {
float real, imag; } __pyx_t_float_complex;
1159 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float,
float);
1164 typedef ::std::complex< double > __pyx_t_double_complex;
1166 typedef double _Complex __pyx_t_double_complex;
1169 typedef struct {
double real, imag; } __pyx_t_double_complex;
1171 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double,
double);
1175 struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix;
1176 struct __pyx_obj_10csmoothers_cASMFactor;
1177 struct __pyx_obj_10csmoothers_cBASMFactor;
1178 struct __pyx_array_obj;
1179 struct __pyx_MemviewEnum_obj;
1180 struct __pyx_memoryview_obj;
1181 struct __pyx_memoryviewslice_obj;
1190 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1199 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1208 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1217 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1218 struct __pyx_t_7proteus_15superluWrappers__NRformat;
1227 struct __pyx_t_7proteus_15superluWrappers__NRformat {
1228 __pyx_t_5numpy_int32_t
nnz;
1229 __pyx_t_5numpy_float64_t *nzval;
1230 __pyx_t_5numpy_int32_t *colind;
1231 __pyx_t_5numpy_int32_t *rowptr;
1241 typedef __Pyx_memviewslice __pyx_t_10csmoothers_DDATA;
1250 typedef __Pyx_memviewslice __pyx_t_10csmoothers_IDATA;
1259 typedef SuperMatrix __pyx_t_10csmoothers_SuperMatrix;
1268 struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix {
1270 __pyx_t_5numpy_int32_t dim[2];
1271 struct __pyx_t_7proteus_15superluWrappers__NRformat A;
1282 struct __pyx_obj_10csmoothers_cASMFactor {
1287 double **subdomain_L;
1288 double **subdomain_R;
1289 double **subdomain_dX;
1290 __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER **subdomain_pivots;
1301 struct __pyx_obj_10csmoothers_cBASMFactor {
1307 double **subdomain_L;
1308 double **subdomain_R;
1309 double **subdomain_dX;
1310 __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER **subdomain_pivots;
1311 __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER **subdomain_col_pivots;
1322 struct __pyx_array_obj {
1324 struct __pyx_vtabstruct_array *__pyx_vtab;
1330 Py_ssize_t *_strides;
1331 Py_ssize_t itemsize;
1334 void (*callback_free_data)(
void *);
1336 int dtype_is_object;
1347 struct __pyx_MemviewEnum_obj {
1360 struct __pyx_memoryview_obj {
1362 struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1365 PyObject *_array_interface;
1366 PyThread_type_lock lock;
1367 __pyx_atomic_int acquisition_count[2];
1368 __pyx_atomic_int *acquisition_count_aligned_p;
1371 int dtype_is_object;
1372 __Pyx_TypeInfo *typeinfo;
1383 struct __pyx_memoryviewslice_obj {
1384 struct __pyx_memoryview_obj __pyx_base;
1385 __Pyx_memviewslice from_slice;
1386 PyObject *from_object;
1387 PyObject *(*to_object_func)(
char *);
1388 int (*to_dtype_func)(
char *, PyObject *);
1401 struct __pyx_vtabstruct_array {
1402 PyObject *(*get_memview)(
struct __pyx_array_obj *);
1404 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1415 struct __pyx_vtabstruct_memoryview {
1416 char *(*get_item_pointer)(
struct __pyx_memoryview_obj *, PyObject *);
1417 PyObject *(*is_slice)(
struct __pyx_memoryview_obj *, PyObject *);
1418 PyObject *(*setitem_slice_assignment)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1419 PyObject *(*setitem_slice_assign_scalar)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *);
1420 PyObject *(*setitem_indexed)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1421 PyObject *(*convert_item_to_object)(
struct __pyx_memoryview_obj *,
char *);
1422 PyObject *(*assign_item_from_object)(
struct __pyx_memoryview_obj *,
char *, PyObject *);
1424 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1435 struct __pyx_vtabstruct__memoryviewslice {
1436 struct __pyx_vtabstruct_memoryview __pyx_base;
1438 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1442 #ifndef CYTHON_REFNANNY 1443 #define CYTHON_REFNANNY 0 1447 void (*INCREF)(
void*, PyObject*, int);
1448 void (*DECREF)(
void*, PyObject*, int);
1449 void (*GOTREF)(
void*, PyObject*, int);
1450 void (*GIVEREF)(
void*, PyObject*, int);
1451 void* (*SetupContext)(
const char*, int,
const char*);
1452 void (*FinishContext)(
void**);
1453 } __Pyx_RefNannyAPIStruct;
1454 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1455 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1456 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; 1458 #define __Pyx_RefNannySetupContext(name, acquire_gil)\ 1460 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ 1461 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ 1462 PyGILState_Release(__pyx_gilstate_save);\ 1464 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ 1467 #define __Pyx_RefNannySetupContext(name, acquire_gil)\ 1468 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) 1470 #define __Pyx_RefNannyFinishContext()\ 1471 __Pyx_RefNanny->FinishContext(&__pyx_refnanny) 1472 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1473 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1474 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1475 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1476 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) 1477 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) 1478 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) 1479 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) 1481 #define __Pyx_RefNannyDeclarations 1482 #define __Pyx_RefNannySetupContext(name, acquire_gil) 1483 #define __Pyx_RefNannyFinishContext() 1484 #define __Pyx_INCREF(r) Py_INCREF(r) 1485 #define __Pyx_DECREF(r) Py_DECREF(r) 1486 #define __Pyx_GOTREF(r) 1487 #define __Pyx_GIVEREF(r) 1488 #define __Pyx_XINCREF(r) Py_XINCREF(r) 1489 #define __Pyx_XDECREF(r) Py_XDECREF(r) 1490 #define __Pyx_XGOTREF(r) 1491 #define __Pyx_XGIVEREF(r) 1493 #define __Pyx_XDECREF_SET(r, v) do {\ 1494 PyObject *tmp = (PyObject *) r;\ 1495 r = v; __Pyx_XDECREF(tmp);\ 1497 #define __Pyx_DECREF_SET(r, v) do {\ 1498 PyObject *tmp = (PyObject *) r;\ 1499 r = v; __Pyx_DECREF(tmp);\ 1501 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) 1502 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) 1505 #if CYTHON_USE_TYPE_SLOTS 1506 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1508 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) 1512 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1515 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1516 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1519 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1522 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1523 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1524 const char* function_name);
1527 #if CYTHON_USE_TYPE_SLOTS 1528 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) 1529 static CYTHON_INLINE
int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
1531 #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) 1532 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) 1536 #if CYTHON_FAST_PYCCALL 1537 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1539 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) 1543 #if CYTHON_FAST_PYCALL 1544 #define __Pyx_PyFunction_FastCall(func, args, nargs)\ 1545 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) 1546 #if 1 || PY_VERSION_HEX < 0x030600B1 1547 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1549 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) 1551 #define __Pyx_BUILD_ASSERT_EXPR(cond)\ 1552 (sizeof(char [1 - 2*!(cond)]) - 1) 1553 #ifndef Py_MEMBER_SIZE 1554 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) 1556 static size_t __pyx_pyframe_localsplus_offset = 0;
1557 #include "frameobject.h" 1558 #define __Pxy_PyFrame_Initialize_Offsets()\ 1559 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ 1560 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) 1561 #define __Pyx_PyFrame_GetLocalsplus(frame)\ 1562 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) 1566 #if CYTHON_COMPILING_IN_CPYTHON 1567 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1569 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) 1573 #if CYTHON_COMPILING_IN_CPYTHON 1574 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1578 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1581 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ 1582 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ 1583 __Pyx__ArgTypeTest(obj, type, name, exact)) 1584 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact);
1587 #if CYTHON_FAST_THREAD_STATE 1588 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; 1589 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; 1590 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type 1592 #define __Pyx_PyThreadState_declare 1593 #define __Pyx_PyThreadState_assign 1594 #define __Pyx_PyErr_Occurred() PyErr_Occurred() 1598 #if CYTHON_FAST_THREAD_STATE 1599 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) 1600 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) 1601 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) 1602 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) 1603 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) 1604 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1605 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1606 #if CYTHON_COMPILING_IN_CPYTHON 1607 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) 1609 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) 1612 #define __Pyx_PyErr_Clear() PyErr_Clear() 1613 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) 1614 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) 1615 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) 1616 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) 1617 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) 1618 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) 1619 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) 1623 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1626 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1629 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d 1630 #define __Pyx_MEMVIEW_DIRECT 1 1631 #define __Pyx_MEMVIEW_PTR 2 1632 #define __Pyx_MEMVIEW_FULL 4 1633 #define __Pyx_MEMVIEW_CONTIG 8 1634 #define __Pyx_MEMVIEW_STRIDED 16 1635 #define __Pyx_MEMVIEW_FOLLOW 32 1636 #define __Pyx_IS_C_CONTIG 1 1637 #define __Pyx_IS_F_CONTIG 2 1638 static int __Pyx_init_memviewslice(
1639 struct __pyx_memoryview_obj *memview,
1641 __Pyx_memviewslice *memviewslice,
1642 int memview_is_new_reference);
1643 static CYTHON_INLINE
int __pyx_add_acquisition_count_locked(
1644 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1645 static CYTHON_INLINE
int __pyx_sub_acquisition_count_locked(
1646 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1647 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p) 1648 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview)) 1649 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__) 1650 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__) 1651 static CYTHON_INLINE
void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
1652 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
1655 static void __Pyx_RaiseBufferIndexError(
int axis);
1658 static void __Pyx_WriteUnraisable(
const char *name,
int clineno,
1659 int lineno,
const char *filename,
1660 int full_traceback,
int nogil);
1663 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY 1664 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1665 #define __Pyx_PyObject_Dict_GetItem(obj, name)\ 1666 (likely(PyDict_CheckExact(obj)) ?\ 1667 __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name)) 1669 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) 1670 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name) 1674 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1677 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1680 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void);
1683 #if CYTHON_USE_EXC_INFO_STACK 1684 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1688 #if CYTHON_FAST_THREAD_STATE 1689 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) 1690 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1691 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) 1692 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1694 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) 1695 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) 1699 #if CYTHON_FAST_THREAD_STATE 1700 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) 1701 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1703 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) 1707 #if CYTHON_FAST_THREAD_STATE 1708 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) 1709 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1711 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1715 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2);
1721 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals);
1724 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals);
1727 #if PY_MAJOR_VERSION >= 3 1728 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals 1730 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals 1734 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
1737 #define UNARY_NEG_WOULD_OVERFLOW(x)\ 1738 (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x))) 1740 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
1741 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *);
1743 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1746 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ 1747 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ 1748 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ 1749 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ 1750 __Pyx_GetItemInt_Generic(o, to_py_func(i)))) 1751 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ 1752 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ 1753 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ 1754 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) 1755 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1756 int wraparound,
int boundscheck);
1757 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ 1758 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ 1759 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ 1760 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) 1761 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1762 int wraparound,
int boundscheck);
1763 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1764 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1765 int is_list,
int wraparound,
int boundscheck);
1768 #if CYTHON_USE_TYPE_SLOTS 1769 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1771 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) 1775 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(
const char *
s, Py_ssize_t size,
const char *errors) {
1777 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
1779 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(
const char *
s, Py_ssize_t size,
const char *errors) {
1781 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
1783 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(
const char *
s, Py_ssize_t size,
const char *errors) {
1785 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
1789 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
1790 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
1791 const char* encoding,
const char* errors,
1792 PyObject* (*decode_func)(
const char *
s, Py_ssize_t size,
const char *errors));
1795 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1798 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS 1799 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) 1800 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) 1801 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ 1802 (version_var) = __PYX_GET_DICT_VERSION(dict);\ 1803 (cache_var) = (value); 1804 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ 1805 static PY_UINT64_T __pyx_dict_version = 0;\ 1806 static PyObject *__pyx_dict_cached_value = NULL;\ 1807 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ 1808 (VAR) = __pyx_dict_cached_value;\ 1810 (VAR) = __pyx_dict_cached_value = (LOOKUP);\ 1811 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ 1814 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1815 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1816 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1818 #define __PYX_GET_DICT_VERSION(dict) (0) 1819 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) 1820 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); 1824 #if CYTHON_USE_DICT_VERSIONS 1825 #define __Pyx_GetModuleGlobalName(var, name) {\ 1826 static PY_UINT64_T __pyx_dict_version = 0;\ 1827 static PyObject *__pyx_dict_cached_value = NULL;\ 1828 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ 1829 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ 1830 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ 1832 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\ 1833 PY_UINT64_T __pyx_dict_version;\ 1834 PyObject *__pyx_dict_cached_value;\ 1835 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ 1837 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1839 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) 1840 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) 1841 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1845 #if CYTHON_FAST_THREAD_STATE 1846 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) 1847 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1849 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1853 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
1856 #if CYTHON_COMPILING_IN_CPYTHON 1857 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) 1858 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1859 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1860 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1862 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) 1863 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) 1864 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) 1866 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) 1868 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
1870 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS 1871 static CYTHON_INLINE
int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
1872 PyListObject*
L = (PyListObject*) list;
1873 Py_ssize_t len = Py_SIZE(list);
1874 if (likely(L->allocated > len)) {
1876 PyList_SET_ITEM(list, len, x);
1877 Py_SIZE(list) = len+1;
1880 return PyList_Append(list, x);
1883 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) 1887 #if !CYTHON_COMPILING_IN_PYPY 1888 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace,
int zerodivision_check);
1890 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ 1891 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) 1895 static CYTHON_INLINE
int __Pyx_PyList_Extend(PyObject*
L, PyObject*
v) {
1896 #if CYTHON_COMPILING_IN_CPYTHON 1897 PyObject* none = _PyList_Extend((PyListObject*)
L, v);
1898 if (unlikely(!none))
1903 return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
1908 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS 1909 static CYTHON_INLINE
int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
1910 PyListObject*
L = (PyListObject*) list;
1911 Py_ssize_t len = Py_SIZE(list);
1912 if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
1914 PyList_SET_ITEM(list, len, x);
1915 Py_SIZE(list) = len+1;
1918 return PyList_Append(list, x);
1921 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) 1925 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname);
1928 static CYTHON_INLINE
long __Pyx_div_long(
long,
long);
1931 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1934 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *, PyObject *);
1937 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 1938 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1940 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr 1944 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 1945 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1947 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr 1951 static int __Pyx_setup_reduce(PyObject* type_obj);
1954 static int __Pyx_SetVtable(PyObject *dict,
void *vtable);
1957 #ifndef __PYX_HAVE_RT_ImportType_proto 1958 #define __PYX_HAVE_RT_ImportType_proto 1959 enum __Pyx_ImportType_CheckSize {
1960 __Pyx_ImportType_CheckSize_Error = 0,
1961 __Pyx_ImportType_CheckSize_Warn = 1,
1962 __Pyx_ImportType_CheckSize_Ignore = 2
1964 static PyTypeObject *__Pyx_ImportType(PyObject* module,
const char *module_name,
const char *class_name,
size_t size,
enum __Pyx_ImportType_CheckSize check_size);
1968 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
1971 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
1974 #define __Pyx_CyFunction_USED 1 1975 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 1976 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 1977 #define __Pyx_CYFUNCTION_CCLASS 0x04 1978 #define __Pyx_CyFunction_GetClosure(f)\ 1979 (((__pyx_CyFunctionObject *) (f))->func_closure) 1980 #define __Pyx_CyFunction_GetClassObj(f)\ 1981 (((__pyx_CyFunctionObject *) (f))->func_classobj) 1982 #define __Pyx_CyFunction_Defaults(type, f)\ 1983 ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) 1984 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ 1985 ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) 1987 PyCFunctionObject func;
1988 #if PY_VERSION_HEX < 0x030500A0 1989 PyObject *func_weakreflist;
1991 PyObject *func_dict;
1992 PyObject *func_name;
1993 PyObject *func_qualname;
1995 PyObject *func_globals;
1996 PyObject *func_code;
1997 PyObject *func_closure;
1998 PyObject *func_classobj;
2000 int defaults_pyobjects;
2001 size_t defaults_size;
2003 PyObject *defaults_tuple;
2004 PyObject *defaults_kwdict;
2005 PyObject *(*defaults_getter)(PyObject *);
2006 PyObject *func_annotations;
2007 } __pyx_CyFunctionObject;
2008 static PyTypeObject *__pyx_CyFunctionType = 0;
2009 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType)) 2010 #define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ 2011 __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) 2012 static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
2013 int flags, PyObject* qualname,
2015 PyObject *module, PyObject *globals,
2017 static CYTHON_INLINE
void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2020 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2022 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2024 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2026 static int __pyx_CyFunction_init(
void);
2029 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 2030 #define __Pyx_SetNameInClass(ns, name, value)\ 2031 (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) 2032 #elif CYTHON_COMPILING_IN_CPYTHON 2033 #define __Pyx_SetNameInClass(ns, name, value)\ 2034 (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value)) 2036 #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value) 2040 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
2041 PyObject *mkw, PyObject *modname, PyObject *doc);
2042 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
2043 PyObject *mkw,
int calculate_metaclass,
int allow_py2_metaclass);
2046 #ifdef CYTHON_CLINE_IN_TRACEBACK 2047 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) 2049 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
2054 PyCodeObject* code_object;
2056 } __Pyx_CodeObjectCacheEntry;
2057 struct __Pyx_CodeObjectCache {
2060 __Pyx_CodeObjectCacheEntry* entries;
2062 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2063 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
2064 static PyCodeObject *__pyx_find_code_object(
int code_line);
2065 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
2068 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
2069 int py_line,
const char *filename);
2071 #if PY_MAJOR_VERSION < 3 2072 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags);
2073 static void __Pyx_ReleaseBuffer(Py_buffer *view);
2075 #define __Pyx_GetBuffer PyObject_GetBuffer 2076 #define __Pyx_ReleaseBuffer PyBuffer_Release 2082 Py_ssize_t shape, strides, suboffsets;
2083 } __Pyx_Buf_DimInfo;
2089 __Pyx_Buffer *rcbuffer;
2091 __Pyx_Buf_DimInfo diminfo[8];
2092 } __Pyx_LocalBuf_ND;
2095 static int __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim);
2098 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2099 __Pyx_memviewslice *slice2,
2100 int ndim,
size_t itemsize);
2103 static CYTHON_INLINE PyObject *__pyx_capsule_create(
void *p,
const char *sig);
2108 #define __Pyx_CREAL(z) ((z).real()) 2109 #define __Pyx_CIMAG(z) ((z).imag()) 2111 #define __Pyx_CREAL(z) (__real__(z)) 2112 #define __Pyx_CIMAG(z) (__imag__(z)) 2115 #define __Pyx_CREAL(z) ((z).real) 2116 #define __Pyx_CIMAG(z) ((z).imag) 2118 #if defined(__cplusplus) && CYTHON_CCOMPLEX\ 2119 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103) 2120 #define __Pyx_SET_CREAL(z,x) ((z).real(x)) 2121 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) 2123 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) 2124 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) 2129 #define __Pyx_c_eq_float(a, b) ((a)==(b)) 2130 #define __Pyx_c_sum_float(a, b) ((a)+(b)) 2131 #define __Pyx_c_diff_float(a, b) ((a)-(b)) 2132 #define __Pyx_c_prod_float(a, b) ((a)*(b)) 2133 #define __Pyx_c_quot_float(a, b) ((a)/(b)) 2134 #define __Pyx_c_neg_float(a) (-(a)) 2136 #define __Pyx_c_is_zero_float(z) ((z)==(float)0) 2137 #define __Pyx_c_conj_float(z) (::std::conj(z)) 2139 #define __Pyx_c_abs_float(z) (::std::abs(z)) 2140 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b)) 2143 #define __Pyx_c_is_zero_float(z) ((z)==0) 2144 #define __Pyx_c_conj_float(z) (conjf(z)) 2146 #define __Pyx_c_abs_float(z) (cabsf(z)) 2147 #define __Pyx_c_pow_float(a, b) (cpowf(a, b)) 2151 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2152 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2153 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2154 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2155 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2156 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2157 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2158 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2160 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex);
2161 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2167 #define __Pyx_c_eq_double(a, b) ((a)==(b)) 2168 #define __Pyx_c_sum_double(a, b) ((a)+(b)) 2169 #define __Pyx_c_diff_double(a, b) ((a)-(b)) 2170 #define __Pyx_c_prod_double(a, b) ((a)*(b)) 2171 #define __Pyx_c_quot_double(a, b) ((a)/(b)) 2172 #define __Pyx_c_neg_double(a) (-(a)) 2174 #define __Pyx_c_is_zero_double(z) ((z)==(double)0) 2175 #define __Pyx_c_conj_double(z) (::std::conj(z)) 2177 #define __Pyx_c_abs_double(z) (::std::abs(z)) 2178 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b)) 2181 #define __Pyx_c_is_zero_double(z) ((z)==0) 2182 #define __Pyx_c_conj_double(z) (conj(z)) 2184 #define __Pyx_c_abs_double(z) (cabs(z)) 2185 #define __Pyx_c_pow_double(a, b) (cpow(a, b)) 2189 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2190 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2191 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2192 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2193 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2194 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2195 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2196 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2198 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex);
2199 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2204 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
2207 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(
enum NPY_TYPES value);
2210 static __Pyx_memviewslice
2211 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
2212 const char *mode,
int ndim,
2213 size_t sizeof_dtype,
int contig_flag,
2214 int dtype_is_object);
2217 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
2220 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
2223 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
2226 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *);
2229 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void);
2232 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts);
2233 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2234 __Pyx_BufFmt_StackElem* stack,
2235 __Pyx_TypeInfo* type);
2238 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2241 static int __Pyx_ValidateAndInit_memviewslice(
2246 __Pyx_TypeInfo *dtype,
2247 __Pyx_BufFmt_StackElem stack[],
2248 __Pyx_memviewslice *memviewslice,
2249 PyObject *original_obj);
2252 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *,
int writable_flag);
2255 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *,
int writable_flag);
2258 static int __Pyx_check_binary_version(
void);
2261 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2263 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self);
2264 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2265 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj);
2266 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src);
2267 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(
struct __pyx_memoryview_obj *__pyx_v_self,
struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value);
2268 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
2269 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp);
2270 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2271 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp);
2272 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2285 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2298 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2299 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2300 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2301 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2302 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2303 static CYTHON_INLINE
char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *,
char *,
char *,
int *);
2306 static PyTypeObject *__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix = 0;
2313 static PyTypeObject *__pyx_ptype_10csmoothers_cASMFactor = 0;
2314 static PyTypeObject *__pyx_ptype_10csmoothers_cBASMFactor = 0;
2315 static PyTypeObject *__pyx_array_type = 0;
2316 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2317 static PyTypeObject *__pyx_memoryview_type = 0;
2318 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2319 static PyObject *
generic = 0;
2320 static PyObject *strided = 0;
2321 static PyObject *indirect = 0;
2322 static PyObject *contiguous = 0;
2323 static PyObject *indirect_contiguous = 0;
2324 static int __pyx_memoryview_thread_locks_used;
2325 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2326 static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *,
double,
double, __pyx_t_10csmoothers_DDATA);
2327 static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA);
2328 static void __pyx_f_10csmoothers_smootherWrappersnl_jacobi_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA,
double,
double, __pyx_t_10csmoothers_DDATA);
2329 static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *,
double,
double, __pyx_t_10csmoothers_DDATA);
2330 static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA);
2331 static PyObject *__pyx_f_10csmoothers_smootherWrappers_nl_gauss_seidel_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA,
double,
double, __pyx_t_10csmoothers_DDATA);
2332 static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *,
struct __pyx_obj_10csmoothers_cASMFactor *);
2333 static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *,
double,
struct __pyx_obj_10csmoothers_cASMFactor *, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA);
2334 static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *,
struct __pyx_obj_10csmoothers_cBASMFactor *);
2335 static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *,
double,
struct __pyx_obj_10csmoothers_cBASMFactor *, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA);
2336 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t,
char *,
char *,
char *);
2337 static void *__pyx_align_pointer(
void *,
size_t);
2338 static PyObject *__pyx_memoryview_new(PyObject *,
int,
int, __Pyx_TypeInfo *);
2339 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *);
2340 static PyObject *_unellipsify(PyObject *,
int);
2341 static PyObject *assert_direct_dimensions(Py_ssize_t *,
int);
2342 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *, PyObject *);
2343 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t,
int,
int,
int *, Py_ssize_t, Py_ssize_t, Py_ssize_t,
int,
int,
int,
int);
2344 static char *__pyx_pybuffer_index(Py_buffer *,
char *, Py_ssize_t, Py_ssize_t);
2345 static int __pyx_memslice_transpose(__Pyx_memviewslice *);
2346 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice,
int, PyObject *(*)(
char *),
int (*)(
char *, PyObject *),
int);
2347 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2348 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2349 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *);
2350 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2351 static Py_ssize_t abs_py_ssize_t(Py_ssize_t);
2352 static char __pyx_get_best_slice_order(__Pyx_memviewslice *,
int);
2353 static void _copy_strided_to_strided(
char *, Py_ssize_t *,
char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *,
int,
size_t);
2354 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *,
int,
size_t);
2355 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *,
int);
2356 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t,
int,
char);
2357 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *,
char,
int);
2358 static int __pyx_memoryview_err_extents(
int, Py_ssize_t, Py_ssize_t);
2359 static int __pyx_memoryview_err_dim(PyObject *,
char *,
int);
2360 static int __pyx_memoryview_err(PyObject *,
char *);
2361 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice,
int,
int,
int);
2362 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *,
int,
int);
2363 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *,
int,
int,
int);
2364 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2365 static void __pyx_memoryview_refcount_objects_in_slice(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2366 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *,
int,
size_t,
void *,
int);
2367 static void __pyx_memoryview__slice_assign_scalar(
char *, Py_ssize_t *, Py_ssize_t *,
int,
size_t,
void *);
2368 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *, PyObject *);
2369 static __Pyx_TypeInfo __Pyx_TypeInfo_double = {
"double", NULL,
sizeof(double), { 0 }, 0,
'R', 0, 0 };
2370 static __Pyx_TypeInfo __Pyx_TypeInfo_int = {
"int", NULL,
sizeof(int), { 0 }, 0, IS_UNSIGNED(
int) ?
'U' :
'I', IS_UNSIGNED(
int), 0 };
2371 #define __Pyx_MODULE_NAME "csmoothers" 2372 extern int __pyx_module_is_main_csmoothers;
2373 int __pyx_module_is_main_csmoothers = 0;
2376 static PyObject *__pyx_builtin_object;
2377 static PyObject *__pyx_builtin_TypeError;
2378 static PyObject *__pyx_builtin_ValueError;
2379 static PyObject *__pyx_builtin_range;
2380 static PyObject *__pyx_builtin_RuntimeError;
2381 static PyObject *__pyx_builtin_ImportError;
2382 static PyObject *__pyx_builtin_MemoryError;
2383 static PyObject *__pyx_builtin_enumerate;
2384 static PyObject *__pyx_builtin_Ellipsis;
2385 static PyObject *__pyx_builtin_id;
2386 static PyObject *__pyx_builtin_IndexError;
2387 static const char __pyx_k_A[] =
"A";
2388 static const char __pyx_k_L[] =
"L";
2389 static const char __pyx_k_M[] =
"M";
2390 static const char __pyx_k_O[] =
"O";
2391 static const char __pyx_k_R[] =
"R";
2392 static const char __pyx_k_c[] =
"c";
2393 static const char __pyx_k_w[] =
"w";
2394 static const char __pyx_k_bs[] =
"bs";
2395 static const char __pyx_k_dX[] =
"dX";
2396 static const char __pyx_k_id[] =
"id";
2397 static const char __pyx_k_nc[] =
"nc";
2398 static const char __pyx_k_np[] =
"np";
2399 static const char __pyx_k_nr[] =
"nr";
2400 static const char __pyx_k_doc[] =
"__doc__";
2401 static const char __pyx_k_new[] =
"__new__";
2402 static const char __pyx_k_obj[] =
"obj";
2403 static const char __pyx_k_tol[] =
"tol";
2404 static const char __pyx_k_base[] =
"base";
2405 static const char __pyx_k_dict[] =
"__dict__";
2406 static const char __pyx_k_init[] =
"__init__";
2407 static const char __pyx_k_main[] =
"__main__";
2408 static const char __pyx_k_mode[] =
"mode";
2409 static const char __pyx_k_name[] =
"name";
2410 static const char __pyx_k_ndim[] =
"ndim";
2411 static const char __pyx_k_pack[] =
"pack";
2412 static const char __pyx_k_self[] =
"self";
2413 static const char __pyx_k_size[] =
"size";
2414 static const char __pyx_k_step[] =
"step";
2415 static const char __pyx_k_stop[] =
"stop";
2416 static const char __pyx_k_test[] =
"__test__";
2417 static const char __pyx_k_ASCII[] =
"ASCII";
2418 static const char __pyx_k_class[] =
"__class__";
2419 static const char __pyx_k_error[] =
"error";
2420 static const char __pyx_k_flags[] =
"flags";
2421 static const char __pyx_k_numpy[] =
"numpy";
2422 static const char __pyx_k_range[] =
"range";
2423 static const char __pyx_k_shape[] =
"shape";
2424 static const char __pyx_k_start[] =
"start";
2425 static const char __pyx_k_encode[] =
"encode";
2426 static const char __pyx_k_format[] =
"format";
2427 static const char __pyx_k_import[] =
"__import__";
2428 static const char __pyx_k_module[] =
"__module__";
2429 static const char __pyx_k_name_2[] =
"__name__";
2430 static const char __pyx_k_object[] =
"object";
2431 static const char __pyx_k_pickle[] =
"pickle";
2432 static const char __pyx_k_reduce[] =
"__reduce__";
2433 static const char __pyx_k_struct[] =
"struct";
2434 static const char __pyx_k_unpack[] =
"unpack";
2435 static const char __pyx_k_update[] =
"update";
2436 static const char __pyx_k_fortran[] =
"fortran";
2437 static const char __pyx_k_memview[] =
"memview";
2438 static const char __pyx_k_prepare[] =
"__prepare__";
2439 static const char __pyx_k_Ellipsis[] =
"Ellipsis";
2440 static const char __pyx_k_getstate[] =
"__getstate__";
2441 static const char __pyx_k_itemsize[] =
"itemsize";
2442 static const char __pyx_k_pyx_type[] =
"__pyx_type";
2443 static const char __pyx_k_qualname[] =
"__qualname__";
2444 static const char __pyx_k_setstate[] =
"__setstate__";
2445 static const char __pyx_k_ASMFactor[] =
"ASMFactor";
2446 static const char __pyx_k_TypeError[] =
"TypeError";
2447 static const char __pyx_k_asmFactor[] =
"asmFactor";
2448 static const char __pyx_k_enumerate[] =
"enumerate";
2449 static const char __pyx_k_metaclass[] =
"__metaclass__";
2450 static const char __pyx_k_pyx_state[] =
"__pyx_state";
2451 static const char __pyx_k_reduce_ex[] =
"__reduce_ex__";
2452 static const char __pyx_k_BASMFactor[] =
"BASMFactor";
2453 static const char __pyx_k_IndexError[] =
"IndexError";
2454 static const char __pyx_k_ValueError[] =
"ValueError";
2455 static const char __pyx_k_basmFactor[] =
"basmFactor";
2456 static const char __pyx_k_cASMFactor[] =
"_cASMFactor";
2457 static const char __pyx_k_csmoothers[] =
"csmoothers";
2458 static const char __pyx_k_node_order[] =
"node_order";
2459 static const char __pyx_k_pyx_result[] =
"__pyx_result";
2460 static const char __pyx_k_pyx_vtable[] =
"__pyx_vtable__";
2461 static const char __pyx_k_ImportError[] =
"ImportError";
2462 static const char __pyx_k_MemoryError[] =
"MemoryError";
2463 static const char __pyx_k_PickleError[] =
"PickleError";
2464 static const char __pyx_k_cBASMFactor[] =
"_cBASMFactor";
2465 static const char __pyx_k_RuntimeError[] =
"RuntimeError";
2466 static const char __pyx_k_asm_NR_solve[] =
"asm_NR_solve";
2467 static const char __pyx_k_cASMFactor_2[] =
"cASMFactor";
2468 static const char __pyx_k_pyx_checksum[] =
"__pyx_checksum";
2469 static const char __pyx_k_stringsource[] =
"stringsource";
2470 static const char __pyx_k_basm_NR_solve[] =
"basm_NR_solve";
2471 static const char __pyx_k_cBASMFactor_2[] =
"cBASMFactor";
2472 static const char __pyx_k_cSparseMatrix[] =
"_cSparseMatrix";
2473 static const char __pyx_k_pyx_getbuffer[] =
"__pyx_getbuffer";
2474 static const char __pyx_k_reduce_cython[] =
"__reduce_cython__";
2475 static const char __pyx_k_asm_NR_prepare[] =
"asm_NR_prepare";
2476 static const char __pyx_k_View_MemoryView[] =
"View.MemoryView";
2477 static const char __pyx_k_allocate_buffer[] =
"allocate_buffer";
2478 static const char __pyx_k_basm_NR_prepare[] =
"basm_NR_prepare";
2479 static const char __pyx_k_dtype_is_object[] =
"dtype_is_object";
2480 static const char __pyx_k_jacobi_NR_solve[] =
"jacobi_NR_solve";
2481 static const char __pyx_k_pyx_PickleError[] =
"__pyx_PickleError";
2482 static const char __pyx_k_setstate_cython[] =
"__setstate_cython__";
2483 static const char __pyx_k_ASMFactor___init[] =
"ASMFactor.__init__";
2484 static const char __pyx_k_BASMFactor___init[] =
"BASMFactor.__init__";
2485 static const char __pyx_k_jacobi_NR_prepare[] =
"jacobi_NR_prepare";
2486 static const char __pyx_k_pyx_unpickle_Enum[] =
"__pyx_unpickle_Enum";
2487 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
2488 static const char __pyx_k_nl_jacobi_NR_solve[] =
"nl_jacobi_NR_solve";
2489 static const char __pyx_k_strided_and_direct[] =
"<strided and direct>";
2490 static const char __pyx_k_strided_and_indirect[] =
"<strided and indirect>";
2491 static const char __pyx_k_contiguous_and_direct[] =
"<contiguous and direct>";
2492 static const char __pyx_k_gauss_seidel_NR_solve[] =
"gauss_seidel_NR_solve";
2493 static const char __pyx_k_MemoryView_of_r_object[] =
"<MemoryView of %r object>";
2494 static const char __pyx_k_gauss_seidel_NR_preare[] =
"gauss_seidel_NR_preare";
2495 static const char __pyx_k_proteus_csmoothers_pyx[] =
"proteus/csmoothers.pyx";
2496 static const char __pyx_k_MemoryView_of_r_at_0x_x[] =
"<MemoryView of %r at 0x%x>";
2497 static const char __pyx_k_contiguous_and_indirect[] =
"<contiguous and indirect>";
2498 static const char __pyx_k_Cannot_index_with_type_s[] =
"Cannot index with type '%s'";
2499 static const char __pyx_k_nl_gauss_seidel_NR_solve[] =
"nl_gauss_seidel_NR_solve";
2500 static const char __pyx_k_Invalid_shape_in_axis_d_d[] =
"Invalid shape in axis %d: %d.";
2501 static const char __pyx_k_itemsize_0_for_cython_array[] =
"itemsize <= 0 for cython.array";
2502 static const char __pyx_k_ndarray_is_not_C_contiguous[] =
"ndarray is not C contiguous";
2503 static const char __pyx_k_unable_to_allocate_array_data[] =
"unable to allocate array data.";
2504 static const char __pyx_k_strided_and_direct_or_indirect[] =
"<strided and direct or indirect>";
2505 static const char __pyx_k_numpy_core_multiarray_failed_to[] =
"numpy.core.multiarray failed to import";
2506 static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] =
"unknown dtype code in numpy.pxd (%d)";
2507 static const char __pyx_k_Buffer_view_does_not_expose_stri[] =
"Buffer view does not expose strides";
2508 static const char __pyx_k_Can_only_create_a_buffer_that_is[] =
"Can only create a buffer that is contiguous in memory.";
2509 static const char __pyx_k_Cannot_assign_to_read_only_memor[] =
"Cannot assign to read-only memoryview";
2510 static const char __pyx_k_Cannot_create_writable_memory_vi[] =
"Cannot create writable memory view from read-only memoryview";
2511 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] =
"Empty shape tuple for cython.array";
2512 static const char __pyx_k_Format_string_allocated_too_shor[] =
"Format string allocated too short, see comment in numpy.pxd";
2513 static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] =
"Incompatible checksums (%s vs 0xb068931 = (name))";
2514 static const char __pyx_k_Indirect_dimensions_not_supporte[] =
"Indirect dimensions not supported";
2515 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] =
"Invalid mode, expected 'c' or 'fortran', got %s";
2516 static const char __pyx_k_Non_native_byte_order_not_suppor[] =
"Non-native byte order not supported";
2517 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] =
"Out of bounds on buffer access (axis %d)";
2518 static const char __pyx_k_Unable_to_convert_item_to_object[] =
"Unable to convert item to object";
2519 static const char __pyx_k_got_differing_extents_in_dimensi[] =
"got differing extents in dimension %d (got %d and %d)";
2520 static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] =
"ndarray is not Fortran contiguous";
2521 static const char __pyx_k_no_default___reduce___due_to_non[] =
"no default __reduce__ due to non-trivial __cinit__";
2522 static const char __pyx_k_numpy_core_umath_failed_to_impor[] =
"numpy.core.umath failed to import";
2523 static const char __pyx_k_unable_to_allocate_shape_and_str[] =
"unable to allocate shape and strides.";
2524 static const char __pyx_k_Format_string_allocated_too_shor_2[] =
"Format string allocated too short.";
2525 static PyObject *__pyx_n_s_A;
2526 static PyObject *__pyx_n_s_ASCII;
2527 static PyObject *__pyx_n_s_ASMFactor;
2528 static PyObject *__pyx_n_s_ASMFactor___init;
2529 static PyObject *__pyx_n_s_BASMFactor;
2530 static PyObject *__pyx_n_s_BASMFactor___init;
2531 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2532 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2533 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2534 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2535 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2536 static PyObject *__pyx_n_s_Ellipsis;
2537 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2538 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
2539 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
2540 static PyObject *__pyx_n_s_ImportError;
2541 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0;
2542 static PyObject *__pyx_n_s_IndexError;
2543 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2544 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2545 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2546 static PyObject *__pyx_n_s_L;
2547 static PyObject *__pyx_n_s_M;
2548 static PyObject *__pyx_n_s_MemoryError;
2549 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2550 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2551 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
2552 static PyObject *__pyx_n_b_O;
2553 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2554 static PyObject *__pyx_n_s_PickleError;
2555 static PyObject *__pyx_n_s_R;
2556 static PyObject *__pyx_n_s_RuntimeError;
2557 static PyObject *__pyx_n_s_TypeError;
2558 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2559 static PyObject *__pyx_n_s_ValueError;
2560 static PyObject *__pyx_n_s_View_MemoryView;
2561 static PyObject *__pyx_n_s_allocate_buffer;
2562 static PyObject *__pyx_n_s_asmFactor;
2563 static PyObject *__pyx_n_s_asm_NR_prepare;
2564 static PyObject *__pyx_n_s_asm_NR_solve;
2565 static PyObject *__pyx_n_s_base;
2566 static PyObject *__pyx_n_s_basmFactor;
2567 static PyObject *__pyx_n_s_basm_NR_prepare;
2568 static PyObject *__pyx_n_s_basm_NR_solve;
2569 static PyObject *__pyx_n_s_bs;
2570 static PyObject *__pyx_n_s_c;
2571 static PyObject *__pyx_n_u_c;
2572 static PyObject *__pyx_n_s_cASMFactor;
2573 static PyObject *__pyx_n_s_cASMFactor_2;
2574 static PyObject *__pyx_n_s_cBASMFactor;
2575 static PyObject *__pyx_n_s_cBASMFactor_2;
2576 static PyObject *__pyx_n_s_cSparseMatrix;
2577 static PyObject *__pyx_n_s_class;
2578 static PyObject *__pyx_n_s_cline_in_traceback;
2579 static PyObject *__pyx_kp_s_contiguous_and_direct;
2580 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2581 static PyObject *__pyx_n_s_csmoothers;
2582 static PyObject *__pyx_n_s_dX;
2583 static PyObject *__pyx_n_s_dict;
2584 static PyObject *__pyx_n_s_doc;
2585 static PyObject *__pyx_n_s_dtype_is_object;
2586 static PyObject *__pyx_n_s_encode;
2587 static PyObject *__pyx_n_s_enumerate;
2588 static PyObject *__pyx_n_s_error;
2589 static PyObject *__pyx_n_s_flags;
2590 static PyObject *__pyx_n_s_format;
2591 static PyObject *__pyx_n_s_fortran;
2592 static PyObject *__pyx_n_u_fortran;
2593 static PyObject *__pyx_n_s_gauss_seidel_NR_preare;
2594 static PyObject *__pyx_n_s_gauss_seidel_NR_solve;
2595 static PyObject *__pyx_n_s_getstate;
2596 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2597 static PyObject *__pyx_n_s_id;
2598 static PyObject *__pyx_n_s_import;
2599 static PyObject *__pyx_n_s_init;
2600 static PyObject *__pyx_n_s_itemsize;
2601 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2602 static PyObject *__pyx_n_s_jacobi_NR_prepare;
2603 static PyObject *__pyx_n_s_jacobi_NR_solve;
2604 static PyObject *__pyx_n_s_main;
2605 static PyObject *__pyx_n_s_memview;
2606 static PyObject *__pyx_n_s_metaclass;
2607 static PyObject *__pyx_n_s_mode;
2608 static PyObject *__pyx_n_s_module;
2609 static PyObject *__pyx_n_s_name;
2610 static PyObject *__pyx_n_s_name_2;
2611 static PyObject *__pyx_n_s_nc;
2612 static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
2613 static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
2614 static PyObject *__pyx_n_s_ndim;
2615 static PyObject *__pyx_n_s_new;
2616 static PyObject *__pyx_n_s_nl_gauss_seidel_NR_solve;
2617 static PyObject *__pyx_n_s_nl_jacobi_NR_solve;
2618 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2619 static PyObject *__pyx_n_s_node_order;
2620 static PyObject *__pyx_n_s_np;
2621 static PyObject *__pyx_n_s_nr;
2622 static PyObject *__pyx_n_s_numpy;
2623 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2624 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2625 static PyObject *__pyx_n_s_obj;
2626 static PyObject *__pyx_n_s_object;
2627 static PyObject *__pyx_n_s_pack;
2628 static PyObject *__pyx_n_s_pickle;
2629 static PyObject *__pyx_n_s_prepare;
2630 static PyObject *__pyx_kp_s_proteus_csmoothers_pyx;
2631 static PyObject *__pyx_n_s_pyx_PickleError;
2632 static PyObject *__pyx_n_s_pyx_checksum;
2633 static PyObject *__pyx_n_s_pyx_getbuffer;
2634 static PyObject *__pyx_n_s_pyx_result;
2635 static PyObject *__pyx_n_s_pyx_state;
2636 static PyObject *__pyx_n_s_pyx_type;
2637 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2638 static PyObject *__pyx_n_s_pyx_vtable;
2639 static PyObject *__pyx_n_s_qualname;
2640 static PyObject *__pyx_n_s_range;
2641 static PyObject *__pyx_n_s_reduce;
2642 static PyObject *__pyx_n_s_reduce_cython;
2643 static PyObject *__pyx_n_s_reduce_ex;
2644 static PyObject *__pyx_n_s_self;
2645 static PyObject *__pyx_n_s_setstate;
2646 static PyObject *__pyx_n_s_setstate_cython;
2647 static PyObject *__pyx_n_s_shape;
2648 static PyObject *__pyx_n_s_size;
2649 static PyObject *__pyx_n_s_start;
2650 static PyObject *__pyx_n_s_step;
2651 static PyObject *__pyx_n_s_stop;
2652 static PyObject *__pyx_kp_s_strided_and_direct;
2653 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2654 static PyObject *__pyx_kp_s_strided_and_indirect;
2655 static PyObject *__pyx_kp_s_stringsource;
2656 static PyObject *__pyx_n_s_struct;
2657 static PyObject *__pyx_n_s_test;
2658 static PyObject *__pyx_n_s_tol;
2659 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2660 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2661 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
2662 static PyObject *__pyx_n_s_unpack;
2663 static PyObject *__pyx_n_s_update;
2664 static PyObject *__pyx_n_s_w;
2665 static PyObject *__pyx_pf_10csmoothers_9ASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L);
2666 static int __pyx_pf_10csmoothers_10cASMFactor___cinit__(
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self,
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L);
2667 static void __pyx_pf_10csmoothers_10cASMFactor_2__dealloc__(
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self);
2668 static PyObject *__pyx_pf_10csmoothers_10cASMFactor_4__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self);
2669 static PyObject *__pyx_pf_10csmoothers_10cASMFactor_6__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2670 static PyObject *__pyx_pf_10csmoothers_10BASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L, PyObject *__pyx_v_bs);
2671 static int __pyx_pf_10csmoothers_11cBASMFactor___cinit__(
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self,
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L,
int __pyx_v_bs);
2672 static void __pyx_pf_10csmoothers_11cBASMFactor_2__dealloc__(
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self);
2673 static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_4__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self);
2674 static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_6__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2675 static PyObject *__pyx_pf_10csmoothers_jacobi_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M);
2676 static PyObject *__pyx_pf_10csmoothers_2jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX);
2677 static PyObject *__pyx_pf_10csmoothers_4nl_jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX);
2678 static PyObject *__pyx_pf_10csmoothers_6gauss_seidel_NR_preare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M);
2679 static PyObject *__pyx_pf_10csmoothers_8gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX);
2680 static PyObject *__pyx_pf_10csmoothers_10nl_gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX);
2681 static PyObject *__pyx_pf_10csmoothers_12asm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_asmFactor);
2682 static PyObject *__pyx_pf_10csmoothers_14asm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_asmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX);
2683 static PyObject *__pyx_pf_10csmoothers_16basm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_basmFactor);
2684 static PyObject *__pyx_pf_10csmoothers_18basm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_basmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX);
2685 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2686 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info);
2687 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode,
int __pyx_v_allocate_buffer);
2688 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(
struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2689 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self);
2690 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self);
2691 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self);
2692 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr);
2693 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item);
2694 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
2695 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self);
2696 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2697 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name);
2698 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
2699 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
2700 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state);
2701 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj,
int __pyx_v_flags,
int __pyx_v_dtype_is_object);
2702 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self);
2703 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2704 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
2705 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(
struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2706 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2707 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2708 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2709 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2710 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2711 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2712 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2713 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2714 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2715 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self);
2716 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self);
2717 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self);
2718 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
2719 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
2720 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self);
2721 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self);
2722 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self);
2723 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2724 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2725 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2726 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2727 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2728 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state);
2729 static PyObject *__pyx_tp_new_10csmoothers_cASMFactor(PyTypeObject *t, PyObject *a, PyObject *k);
2730 static PyObject *__pyx_tp_new_10csmoothers_cBASMFactor(PyTypeObject *t, PyObject *a, PyObject *k);
2731 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k);
2732 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k);
2733 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k);
2734 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k);
2735 static PyObject *__pyx_int_0;
2736 static PyObject *__pyx_int_1;
2737 static PyObject *__pyx_int_184977713;
2738 static PyObject *__pyx_int_neg_1;
2739 static PyObject *__pyx_tuple_;
2740 static PyObject *__pyx_tuple__2;
2741 static PyObject *__pyx_tuple__3;
2742 static PyObject *__pyx_tuple__4;
2743 static PyObject *__pyx_tuple__5;
2744 static PyObject *__pyx_tuple__6;
2745 static PyObject *__pyx_tuple__7;
2746 static PyObject *__pyx_tuple__8;
2747 static PyObject *__pyx_tuple__9;
2748 static PyObject *__pyx_slice__26;
2749 static PyObject *__pyx_tuple__10;
2750 static PyObject *__pyx_tuple__11;
2751 static PyObject *__pyx_tuple__12;
2752 static PyObject *__pyx_tuple__13;
2753 static PyObject *__pyx_tuple__14;
2754 static PyObject *__pyx_tuple__15;
2755 static PyObject *__pyx_tuple__16;
2756 static PyObject *__pyx_tuple__17;
2757 static PyObject *__pyx_tuple__18;
2758 static PyObject *__pyx_tuple__19;
2759 static PyObject *__pyx_tuple__20;
2760 static PyObject *__pyx_tuple__21;
2761 static PyObject *__pyx_tuple__22;
2762 static PyObject *__pyx_tuple__23;
2763 static PyObject *__pyx_tuple__24;
2764 static PyObject *__pyx_tuple__25;
2765 static PyObject *__pyx_tuple__27;
2766 static PyObject *__pyx_tuple__28;
2767 static PyObject *__pyx_tuple__29;
2768 static PyObject *__pyx_tuple__30;
2769 static PyObject *__pyx_tuple__31;
2770 static PyObject *__pyx_tuple__33;
2771 static PyObject *__pyx_tuple__34;
2772 static PyObject *__pyx_tuple__36;
2773 static PyObject *__pyx_tuple__38;
2774 static PyObject *__pyx_tuple__40;
2775 static PyObject *__pyx_tuple__42;
2776 static PyObject *__pyx_tuple__44;
2777 static PyObject *__pyx_tuple__46;
2778 static PyObject *__pyx_tuple__48;
2779 static PyObject *__pyx_tuple__50;
2780 static PyObject *__pyx_tuple__52;
2781 static PyObject *__pyx_tuple__54;
2782 static PyObject *__pyx_tuple__56;
2783 static PyObject *__pyx_tuple__57;
2784 static PyObject *__pyx_tuple__58;
2785 static PyObject *__pyx_tuple__59;
2786 static PyObject *__pyx_tuple__60;
2787 static PyObject *__pyx_tuple__61;
2788 static PyObject *__pyx_codeobj__32;
2789 static PyObject *__pyx_codeobj__35;
2790 static PyObject *__pyx_codeobj__37;
2791 static PyObject *__pyx_codeobj__39;
2792 static PyObject *__pyx_codeobj__41;
2793 static PyObject *__pyx_codeobj__43;
2794 static PyObject *__pyx_codeobj__45;
2795 static PyObject *__pyx_codeobj__47;
2796 static PyObject *__pyx_codeobj__49;
2797 static PyObject *__pyx_codeobj__51;
2798 static PyObject *__pyx_codeobj__53;
2799 static PyObject *__pyx_codeobj__55;
2800 static PyObject *__pyx_codeobj__62;
2812 static PyObject *__pyx_pw_10csmoothers_9ASMFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2813 static PyMethodDef __pyx_mdef_10csmoothers_9ASMFactor_1__init__ = {
"__init__", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_9ASMFactor_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
2814 static PyObject *__pyx_pw_10csmoothers_9ASMFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2815 PyObject *__pyx_v_self = 0;
2816 PyObject *__pyx_v_L = 0;
2817 PyObject *__pyx_r = 0;
2818 __Pyx_RefNannyDeclarations
2819 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
2821 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_L,0};
2822 PyObject* values[2] = {0,0};
2823 if (unlikely(__pyx_kwds)) {
2825 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2827 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2829 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2832 default:
goto __pyx_L5_argtuple_error;
2834 kw_args = PyDict_Size(__pyx_kwds);
2837 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
2838 else goto __pyx_L5_argtuple_error;
2841 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
2843 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 2, 2, 1); __PYX_ERR(0, 7, __pyx_L3_error)
2846 if (unlikely(kw_args > 0)) {
2847 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(0, 7, __pyx_L3_error)
2849 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
2850 goto __pyx_L5_argtuple_error;
2852 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2853 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2855 __pyx_v_self = values[0];
2856 __pyx_v_L = values[1];
2858 goto __pyx_L4_argument_unpacking_done;
2859 __pyx_L5_argtuple_error:;
2860 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7, __pyx_L3_error)
2862 __Pyx_AddTraceback(
"csmoothers.ASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2863 __Pyx_RefNannyFinishContext();
2865 __pyx_L4_argument_unpacking_done:;
2866 __pyx_r = __pyx_pf_10csmoothers_9ASMFactor___init__(__pyx_self, __pyx_v_self, __pyx_v_L);
2869 __Pyx_RefNannyFinishContext();
2873 static PyObject *__pyx_pf_10csmoothers_9ASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L) {
2874 PyObject *__pyx_r = NULL;
2875 __Pyx_RefNannyDeclarations
2876 PyObject *__pyx_t_1 = NULL;
2877 PyObject *__pyx_t_2 = NULL;
2878 __Pyx_RefNannySetupContext(
"__init__", 0);
2887 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_L, __pyx_v_L) < 0) __PYX_ERR(0, 8, __pyx_L1_error)
2896 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_L);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
2897 __Pyx_GOTREF(__pyx_t_1);
2898 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error)
2899 __Pyx_GOTREF(__pyx_t_2);
2900 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2901 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_10csmoothers_cASMFactor), __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
2902 __Pyx_GOTREF(__pyx_t_1);
2903 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2904 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cASMFactor, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
2905 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2916 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2919 __Pyx_XDECREF(__pyx_t_1);
2920 __Pyx_XDECREF(__pyx_t_2);
2921 __Pyx_AddTraceback(
"csmoothers.ASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2924 __Pyx_XGIVEREF(__pyx_r);
2925 __Pyx_RefNannyFinishContext();
2938 static int __pyx_pw_10csmoothers_10cASMFactor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2939 static int __pyx_pw_10csmoothers_10cASMFactor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2940 struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L = 0;
2942 __Pyx_RefNannyDeclarations
2943 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
2945 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_L,0};
2946 PyObject* values[1] = {0};
2947 if (unlikely(__pyx_kwds)) {
2949 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2951 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2954 default:
goto __pyx_L5_argtuple_error;
2956 kw_args = PyDict_Size(__pyx_kwds);
2959 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
2960 else goto __pyx_L5_argtuple_error;
2962 if (unlikely(kw_args > 0)) {
2963 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(0, 13, __pyx_L3_error)
2965 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
2966 goto __pyx_L5_argtuple_error;
2968 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2970 __pyx_v_L = ((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)values[0]);
2972 goto __pyx_L4_argument_unpacking_done;
2973 __pyx_L5_argtuple_error:;
2974 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 13, __pyx_L3_error)
2976 __Pyx_AddTraceback(
"csmoothers.cASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2977 __Pyx_RefNannyFinishContext();
2979 __pyx_L4_argument_unpacking_done:;
2980 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_L), __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix, 1,
"L", 0))) __PYX_ERR(0, 14, __pyx_L1_error)
2981 __pyx_r = __pyx_pf_10csmoothers_10cASMFactor___cinit__(((
struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self), __pyx_v_L);
2988 __Pyx_RefNannyFinishContext();
2992 static int __pyx_pf_10csmoothers_10cASMFactor___cinit__(
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self,
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L) {
2994 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
2996 __Pyx_RefNannyDeclarations
2997 PyObject *__pyx_t_1 = NULL;
2999 __Pyx_RefNannySetupContext(
"__cinit__", 0);
3017 __pyx_v_AS.Stype = SLU_NR;
3026 __pyx_v_AS.Dtype = SLU_D;
3035 __pyx_v_AS.Mtype = SLU_GE;
3044 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
3045 __Pyx_GOTREF(__pyx_t_1);
3046 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 20, __pyx_L1_error)
3047 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3048 __pyx_v_AS.nrow = __pyx_t_2;
3057 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
3058 __Pyx_GOTREF(__pyx_t_1);
3059 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 21, __pyx_L1_error)
3060 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3061 __pyx_v_AS.ncol = __pyx_t_2;
3070 __pyx_v_AS.Store = (&__pyx_v_L->A);
3079 __pyx_v_rval =
asm_NR_init((&__pyx_v_AS), (&__pyx_v_self->subdomain_dim), (&__pyx_v_self->l2g_L), (&__pyx_v_self->subdomain_L), (&__pyx_v_self->subdomain_R), (&__pyx_v_self->subdomain_dX), (&__pyx_v_self->subdomain_pivots));
3088 #ifndef CYTHON_WITHOUT_ASSERTIONS 3089 if (unlikely(!Py_OptimizeFlag)) {
3090 if (unlikely(!((__pyx_v_rval == 0) != 0))) {
3091 PyErr_SetNone(PyExc_AssertionError);
3092 __PYX_ERR(0, 30, __pyx_L1_error)
3109 __Pyx_XDECREF(__pyx_t_1);
3110 __Pyx_AddTraceback(
"csmoothers.cASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3113 __Pyx_RefNannyFinishContext();
3126 static void __pyx_pw_10csmoothers_10cASMFactor_3__dealloc__(PyObject *__pyx_v_self);
3127 static void __pyx_pw_10csmoothers_10cASMFactor_3__dealloc__(PyObject *__pyx_v_self) {
3128 __Pyx_RefNannyDeclarations
3129 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
3130 __pyx_pf_10csmoothers_10cASMFactor_2__dealloc__(((
struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self));
3133 __Pyx_RefNannyFinishContext();
3136 static void __pyx_pf_10csmoothers_10cASMFactor_2__dealloc__(
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self) {
3137 __Pyx_RefNannyDeclarations
3138 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
3147 asm_NR_free(__pyx_v_self->N, __pyx_v_self->subdomain_dim, __pyx_v_self->l2g_L, __pyx_v_self->subdomain_L, __pyx_v_self->subdomain_R, __pyx_v_self->subdomain_dX, __pyx_v_self->subdomain_pivots);
3158 __Pyx_RefNannyFinishContext();
3168 static PyObject *__pyx_pw_10csmoothers_10cASMFactor_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
3169 static PyObject *__pyx_pw_10csmoothers_10cASMFactor_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3170 PyObject *__pyx_r = 0;
3171 __Pyx_RefNannyDeclarations
3172 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
3173 __pyx_r = __pyx_pf_10csmoothers_10cASMFactor_4__reduce_cython__(((
struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self));
3176 __Pyx_RefNannyFinishContext();
3180 static PyObject *__pyx_pf_10csmoothers_10cASMFactor_4__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self) {
3181 PyObject *__pyx_r = NULL;
3182 __Pyx_RefNannyDeclarations
3183 PyObject *__pyx_t_1 = NULL;
3184 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
3192 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
3193 __Pyx_GOTREF(__pyx_t_1);
3194 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3195 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3196 __PYX_ERR(1, 2, __pyx_L1_error)
3206 __Pyx_XDECREF(__pyx_t_1);
3207 __Pyx_AddTraceback(
"csmoothers.cASMFactor.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3209 __Pyx_XGIVEREF(__pyx_r);
3210 __Pyx_RefNannyFinishContext();
3222 static PyObject *__pyx_pw_10csmoothers_10cASMFactor_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
3223 static PyObject *__pyx_pw_10csmoothers_10cASMFactor_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3224 PyObject *__pyx_r = 0;
3225 __Pyx_RefNannyDeclarations
3226 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
3227 __pyx_r = __pyx_pf_10csmoothers_10cASMFactor_6__setstate_cython__(((
struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
3230 __Pyx_RefNannyFinishContext();
3234 static PyObject *__pyx_pf_10csmoothers_10cASMFactor_6__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
3235 PyObject *__pyx_r = NULL;
3236 __Pyx_RefNannyDeclarations
3237 PyObject *__pyx_t_1 = NULL;
3238 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
3245 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
3246 __Pyx_GOTREF(__pyx_t_1);
3247 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3248 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3249 __PYX_ERR(1, 4, __pyx_L1_error)
3260 __Pyx_XDECREF(__pyx_t_1);
3261 __Pyx_AddTraceback(
"csmoothers.cASMFactor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3263 __Pyx_XGIVEREF(__pyx_r);
3264 __Pyx_RefNannyFinishContext();
3277 static PyObject *__pyx_pw_10csmoothers_10BASMFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3278 static PyMethodDef __pyx_mdef_10csmoothers_10BASMFactor_1__init__ = {
"__init__", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_10BASMFactor_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
3279 static PyObject *__pyx_pw_10csmoothers_10BASMFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3280 PyObject *__pyx_v_self = 0;
3281 PyObject *__pyx_v_L = 0;
3282 PyObject *__pyx_v_bs = 0;
3283 PyObject *__pyx_r = 0;
3284 __Pyx_RefNannyDeclarations
3285 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
3287 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_L,&__pyx_n_s_bs,0};
3288 PyObject* values[3] = {0,0,0};
3289 if (unlikely(__pyx_kwds)) {
3291 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3293 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3295 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3297 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3300 default:
goto __pyx_L5_argtuple_error;
3302 kw_args = PyDict_Size(__pyx_kwds);
3305 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
3306 else goto __pyx_L5_argtuple_error;
3309 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
3311 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 3, 3, 1); __PYX_ERR(0, 44, __pyx_L3_error)
3315 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bs)) != 0)) kw_args--;
3317 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 3, 3, 2); __PYX_ERR(0, 44, __pyx_L3_error)
3320 if (unlikely(kw_args > 0)) {
3321 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(0, 44, __pyx_L3_error)
3323 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3324 goto __pyx_L5_argtuple_error;
3326 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3327 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3328 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3330 __pyx_v_self = values[0];
3331 __pyx_v_L = values[1];
3332 __pyx_v_bs = values[2];
3334 goto __pyx_L4_argument_unpacking_done;
3335 __pyx_L5_argtuple_error:;
3336 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 44, __pyx_L3_error)
3338 __Pyx_AddTraceback(
"csmoothers.BASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3339 __Pyx_RefNannyFinishContext();
3341 __pyx_L4_argument_unpacking_done:;
3342 __pyx_r = __pyx_pf_10csmoothers_10BASMFactor___init__(__pyx_self, __pyx_v_self, __pyx_v_L, __pyx_v_bs);
3345 __Pyx_RefNannyFinishContext();
3349 static PyObject *__pyx_pf_10csmoothers_10BASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L, PyObject *__pyx_v_bs) {
3350 PyObject *__pyx_r = NULL;
3351 __Pyx_RefNannyDeclarations
3352 PyObject *__pyx_t_1 = NULL;
3353 PyObject *__pyx_t_2 = NULL;
3354 PyObject *__pyx_t_3 = NULL;
3355 __Pyx_RefNannySetupContext(
"__init__", 0);
3364 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_L, __pyx_v_L) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
3373 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_bs, __pyx_v_bs) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
3382 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_L);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
3383 __Pyx_GOTREF(__pyx_t_1);
3384 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error)
3385 __Pyx_GOTREF(__pyx_t_2);
3386 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3395 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bs);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error)
3396 __Pyx_GOTREF(__pyx_t_1);
3405 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 47, __pyx_L1_error)
3406 __Pyx_GOTREF(__pyx_t_3);
3407 __Pyx_GIVEREF(__pyx_t_2);
3408 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
3409 __Pyx_GIVEREF(__pyx_t_1);
3410 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
3413 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_10csmoothers_cBASMFactor), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
3414 __Pyx_GOTREF(__pyx_t_1);
3415 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3416 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cBASMFactor, __pyx_t_1) < 0) __PYX_ERR(0, 47, __pyx_L1_error)
3417 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3428 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3431 __Pyx_XDECREF(__pyx_t_1);
3432 __Pyx_XDECREF(__pyx_t_2);
3433 __Pyx_XDECREF(__pyx_t_3);
3434 __Pyx_AddTraceback(
"csmoothers.BASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3437 __Pyx_XGIVEREF(__pyx_r);
3438 __Pyx_RefNannyFinishContext();
3451 static int __pyx_pw_10csmoothers_11cBASMFactor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3452 static int __pyx_pw_10csmoothers_11cBASMFactor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3453 struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L = 0;
3456 __Pyx_RefNannyDeclarations
3457 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
3459 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_L,&__pyx_n_s_bs,0};
3460 PyObject* values[2] = {0,0};
3461 if (unlikely(__pyx_kwds)) {
3463 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3465 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3467 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3470 default:
goto __pyx_L5_argtuple_error;
3472 kw_args = PyDict_Size(__pyx_kwds);
3475 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
3476 else goto __pyx_L5_argtuple_error;
3479 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bs)) != 0)) kw_args--;
3481 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 2, 2, 1); __PYX_ERR(0, 52, __pyx_L3_error)
3484 if (unlikely(kw_args > 0)) {
3485 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(0, 52, __pyx_L3_error)
3487 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
3488 goto __pyx_L5_argtuple_error;
3490 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3491 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3493 __pyx_v_L = ((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)values[0]);
3494 __pyx_v_bs = __Pyx_PyInt_As_int(values[1]);
if (unlikely((__pyx_v_bs == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error)
3496 goto __pyx_L4_argument_unpacking_done;
3497 __pyx_L5_argtuple_error:;
3498 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 52, __pyx_L3_error)
3500 __Pyx_AddTraceback(
"csmoothers.cBASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3501 __Pyx_RefNannyFinishContext();
3503 __pyx_L4_argument_unpacking_done:;
3504 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_L), __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix, 1,
"L", 0))) __PYX_ERR(0, 53, __pyx_L1_error)
3505 __pyx_r = __pyx_pf_10csmoothers_11cBASMFactor___cinit__(((
struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self), __pyx_v_L, __pyx_v_bs);
3512 __Pyx_RefNannyFinishContext();
3516 static int __pyx_pf_10csmoothers_11cBASMFactor___cinit__(
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self,
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L,
int __pyx_v_bs) {
3518 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
3520 __Pyx_RefNannyDeclarations
3521 PyObject *__pyx_t_1 = NULL;
3523 __Pyx_RefNannySetupContext(
"__cinit__", 0);
3541 __pyx_v_AS.Stype = SLU_NR;
3550 __pyx_v_AS.Dtype = SLU_D;
3559 __pyx_v_AS.Mtype = SLU_GE;
3568 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error)
3569 __Pyx_GOTREF(__pyx_t_1);
3570 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 60, __pyx_L1_error)
3571 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3572 __pyx_v_AS.nrow = __pyx_t_2;
3581 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error)
3582 __Pyx_GOTREF(__pyx_t_1);
3583 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L1_error)
3584 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3585 __pyx_v_AS.ncol = __pyx_t_2;
3594 __pyx_v_AS.Store = (&__pyx_v_L->A);
3603 __pyx_v_rval =
basm_NR_init(__pyx_v_bs, (&__pyx_v_AS), (&__pyx_v_self->subdomain_dim), (&__pyx_v_self->l2g_L), (&__pyx_v_self->subdomain_L), (&__pyx_v_self->subdomain_R), (&__pyx_v_self->subdomain_dX), (&__pyx_v_self->subdomain_pivots), (&__pyx_v_self->subdomain_col_pivots));
3612 #ifndef CYTHON_WITHOUT_ASSERTIONS 3613 if (unlikely(!Py_OptimizeFlag)) {
3614 if (unlikely(!((__pyx_v_rval == 0) != 0))) {
3615 PyErr_SetNone(PyExc_AssertionError);
3616 __PYX_ERR(0, 72, __pyx_L1_error)
3633 __Pyx_XDECREF(__pyx_t_1);
3634 __Pyx_AddTraceback(
"csmoothers.cBASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3637 __Pyx_RefNannyFinishContext();
3650 static void __pyx_pw_10csmoothers_11cBASMFactor_3__dealloc__(PyObject *__pyx_v_self);
3651 static void __pyx_pw_10csmoothers_11cBASMFactor_3__dealloc__(PyObject *__pyx_v_self) {
3652 __Pyx_RefNannyDeclarations
3653 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
3654 __pyx_pf_10csmoothers_11cBASMFactor_2__dealloc__(((
struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self));
3657 __Pyx_RefNannyFinishContext();
3660 static void __pyx_pf_10csmoothers_11cBASMFactor_2__dealloc__(
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self) {
3661 __Pyx_RefNannyDeclarations
3662 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
3671 basm_NR_free(__pyx_v_self->N, __pyx_v_self->subdomain_dim, __pyx_v_self->l2g_L, __pyx_v_self->subdomain_L, __pyx_v_self->subdomain_R, __pyx_v_self->subdomain_dX, __pyx_v_self->subdomain_pivots, __pyx_v_self->subdomain_col_pivots);
3682 __Pyx_RefNannyFinishContext();
3692 static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
3693 static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3694 PyObject *__pyx_r = 0;
3695 __Pyx_RefNannyDeclarations
3696 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
3697 __pyx_r = __pyx_pf_10csmoothers_11cBASMFactor_4__reduce_cython__(((
struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self));
3700 __Pyx_RefNannyFinishContext();
3704 static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_4__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self) {
3705 PyObject *__pyx_r = NULL;
3706 __Pyx_RefNannyDeclarations
3707 PyObject *__pyx_t_1 = NULL;
3708 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
3716 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
3717 __Pyx_GOTREF(__pyx_t_1);
3718 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3719 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3720 __PYX_ERR(1, 2, __pyx_L1_error)
3730 __Pyx_XDECREF(__pyx_t_1);
3731 __Pyx_AddTraceback(
"csmoothers.cBASMFactor.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3733 __Pyx_XGIVEREF(__pyx_r);
3734 __Pyx_RefNannyFinishContext();
3746 static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
3747 static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3748 PyObject *__pyx_r = 0;
3749 __Pyx_RefNannyDeclarations
3750 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
3751 __pyx_r = __pyx_pf_10csmoothers_11cBASMFactor_6__setstate_cython__(((
struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
3754 __Pyx_RefNannyFinishContext();
3758 static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_6__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
3759 PyObject *__pyx_r = NULL;
3760 __Pyx_RefNannyDeclarations
3761 PyObject *__pyx_t_1 = NULL;
3762 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
3769 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
3770 __Pyx_GOTREF(__pyx_t_1);
3771 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3772 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3773 __PYX_ERR(1, 4, __pyx_L1_error)
3784 __Pyx_XDECREF(__pyx_t_1);
3785 __Pyx_AddTraceback(
"csmoothers.cBASMFactor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3787 __Pyx_XGIVEREF(__pyx_r);
3788 __Pyx_RefNannyFinishContext();
3801 static PyObject *__pyx_pw_10csmoothers_1jacobi_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3802 static char __pyx_doc_10csmoothers_jacobi_NR_prepare[] =
"\n\n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n w : double\n tol : double\n M : np.array\n ";
3803 static PyMethodDef __pyx_mdef_10csmoothers_1jacobi_NR_prepare = {
"jacobi_NR_prepare", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_1jacobi_NR_prepare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_jacobi_NR_prepare};
3804 static PyObject *__pyx_pw_10csmoothers_1jacobi_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3805 PyObject *__pyx_v_A = 0;
3806 PyObject *__pyx_v_w = 0;
3807 PyObject *__pyx_v_tol = 0;
3808 PyObject *__pyx_v_M = 0;
3809 PyObject *__pyx_r = 0;
3810 __Pyx_RefNannyDeclarations
3811 __Pyx_RefNannySetupContext(
"jacobi_NR_prepare (wrapper)", 0);
3813 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_w,&__pyx_n_s_tol,&__pyx_n_s_M,0};
3814 PyObject* values[4] = {0,0,0,0};
3815 if (unlikely(__pyx_kwds)) {
3817 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3819 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3821 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3823 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3825 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3828 default:
goto __pyx_L5_argtuple_error;
3830 kw_args = PyDict_Size(__pyx_kwds);
3833 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
3834 else goto __pyx_L5_argtuple_error;
3837 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
3839 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_prepare", 1, 4, 4, 1); __PYX_ERR(0, 84, __pyx_L3_error)
3843 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
3845 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_prepare", 1, 4, 4, 2); __PYX_ERR(0, 84, __pyx_L3_error)
3849 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_M)) != 0)) kw_args--;
3851 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_prepare", 1, 4, 4, 3); __PYX_ERR(0, 84, __pyx_L3_error)
3854 if (unlikely(kw_args > 0)) {
3855 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"jacobi_NR_prepare") < 0)) __PYX_ERR(0, 84, __pyx_L3_error)
3857 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
3858 goto __pyx_L5_argtuple_error;
3860 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3861 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3862 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3863 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3865 __pyx_v_A = values[0];
3866 __pyx_v_w = values[1];
3867 __pyx_v_tol = values[2];
3868 __pyx_v_M = values[3];
3870 goto __pyx_L4_argument_unpacking_done;
3871 __pyx_L5_argtuple_error:;
3872 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_prepare", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 84, __pyx_L3_error)
3874 __Pyx_AddTraceback(
"csmoothers.jacobi_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
3875 __Pyx_RefNannyFinishContext();
3877 __pyx_L4_argument_unpacking_done:;
3878 __pyx_r = __pyx_pf_10csmoothers_jacobi_NR_prepare(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_tol, __pyx_v_M);
3881 __Pyx_RefNannyFinishContext();
3885 static PyObject *__pyx_pf_10csmoothers_jacobi_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M) {
3886 PyObject *__pyx_r = NULL;
3887 __Pyx_RefNannyDeclarations
3888 PyObject *__pyx_t_1 = NULL;
3891 __pyx_t_10csmoothers_DDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
3892 __Pyx_RefNannySetupContext(
"jacobi_NR_prepare", 0);
3901 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)
3902 __Pyx_GOTREF(__pyx_t_1);
3903 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 94, __pyx_L1_error)
3904 __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_w);
if (unlikely((__pyx_t_2 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L1_error)
3905 __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_tol);
if (unlikely((__pyx_t_3 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L1_error)
3906 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 94, __pyx_L1_error)
3907 __pyx_f_10csmoothers_smootherWrappersjacobi_NR_prepare(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4);
3908 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3909 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
3910 __pyx_t_4.memview = NULL;
3911 __pyx_t_4.data = NULL;
3922 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3925 __Pyx_XDECREF(__pyx_t_1);
3926 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
3927 __Pyx_AddTraceback(
"csmoothers.jacobi_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
3930 __Pyx_XGIVEREF(__pyx_r);
3931 __Pyx_RefNannyFinishContext();
3943 static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm,
double __pyx_v_w,
double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_M) {
3944 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
3945 __Pyx_RefNannyDeclarations
3946 PyObject *__pyx_t_1 = NULL;
3948 Py_ssize_t __pyx_t_3;
3949 __Pyx_RefNannySetupContext(
"smootherWrappersjacobi_NR_prepare", 0);
3958 __pyx_v_AS.Stype = SLU_NR;
3967 __pyx_v_AS.Dtype = SLU_D;
3976 __pyx_v_AS.Mtype = SLU_GE;
3985 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error)
3986 __Pyx_GOTREF(__pyx_t_1);
3987 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error)
3988 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3989 __pyx_v_AS.nrow = __pyx_t_2;
3998 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error)
3999 __Pyx_GOTREF(__pyx_t_1);
4000 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L1_error)
4001 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4002 __pyx_v_AS.ncol = __pyx_t_2;
4011 __pyx_v_AS.Store = (&__pyx_v_sm->A);
4022 if (__pyx_t_3 < 0) {
4023 __pyx_t_3 += __pyx_v_M.shape[0];
4024 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
4025 }
else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
4026 if (unlikely(__pyx_t_2 != -1)) {
4027 __Pyx_RaiseBufferIndexError(__pyx_t_2);
4028 __PYX_ERR(0, 107, __pyx_L1_error)
4030 jacobi_NR_prepare((&__pyx_v_AS), __pyx_v_w, __pyx_v_tol, (&(*((
double *) ( (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))));
4043 __Pyx_XDECREF(__pyx_t_1);
4044 __Pyx_WriteUnraisable(
"csmoothers.smootherWrappersjacobi_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4046 __Pyx_RefNannyFinishContext();
4058 static PyObject *__pyx_pw_10csmoothers_3jacobi_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4059 static char __pyx_doc_10csmoothers_2jacobi_NR_solve[] =
"\n \n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n M : np.array double\n R : np.array double\n node_order : np.array int\n dX : np.array double\n ";
4060 static PyMethodDef __pyx_mdef_10csmoothers_3jacobi_NR_solve = {
"jacobi_NR_solve", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_3jacobi_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_2jacobi_NR_solve};
4061 static PyObject *__pyx_pw_10csmoothers_3jacobi_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4062 PyObject *__pyx_v_A = 0;
4063 PyObject *__pyx_v_M = 0;
4064 PyObject *__pyx_v_R = 0;
4065 PyObject *__pyx_v_node_order = 0;
4066 PyObject *__pyx_v_dX = 0;
4067 PyObject *__pyx_r = 0;
4068 __Pyx_RefNannyDeclarations
4069 __Pyx_RefNannySetupContext(
"jacobi_NR_solve (wrapper)", 0);
4071 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_M,&__pyx_n_s_R,&__pyx_n_s_node_order,&__pyx_n_s_dX,0};
4072 PyObject* values[5] = {0,0,0,0,0};
4073 if (unlikely(__pyx_kwds)) {
4075 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4077 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4079 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4081 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4083 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4085 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4088 default:
goto __pyx_L5_argtuple_error;
4090 kw_args = PyDict_Size(__pyx_kwds);
4093 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
4094 else goto __pyx_L5_argtuple_error;
4097 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_M)) != 0)) kw_args--;
4099 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_solve", 1, 5, 5, 1); __PYX_ERR(0, 109, __pyx_L3_error)
4103 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
4105 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_solve", 1, 5, 5, 2); __PYX_ERR(0, 109, __pyx_L3_error)
4109 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
4111 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_solve", 1, 5, 5, 3); __PYX_ERR(0, 109, __pyx_L3_error)
4115 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
4117 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_solve", 1, 5, 5, 4); __PYX_ERR(0, 109, __pyx_L3_error)
4120 if (unlikely(kw_args > 0)) {
4121 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"jacobi_NR_solve") < 0)) __PYX_ERR(0, 109, __pyx_L3_error)
4123 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
4124 goto __pyx_L5_argtuple_error;
4126 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4127 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4128 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4129 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4130 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4132 __pyx_v_A = values[0];
4133 __pyx_v_M = values[1];
4134 __pyx_v_R = values[2];
4135 __pyx_v_node_order = values[3];
4136 __pyx_v_dX = values[4];
4138 goto __pyx_L4_argument_unpacking_done;
4139 __pyx_L5_argtuple_error:;
4140 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_solve", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 109, __pyx_L3_error)
4142 __Pyx_AddTraceback(
"csmoothers.jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4143 __Pyx_RefNannyFinishContext();
4145 __pyx_L4_argument_unpacking_done:;
4146 __pyx_r = __pyx_pf_10csmoothers_2jacobi_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_M, __pyx_v_R, __pyx_v_node_order, __pyx_v_dX);
4149 __Pyx_RefNannyFinishContext();
4153 static PyObject *__pyx_pf_10csmoothers_2jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX) {
4154 PyObject *__pyx_r = NULL;
4155 __Pyx_RefNannyDeclarations
4156 PyObject *__pyx_t_1 = NULL;
4157 __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
4158 __pyx_t_10csmoothers_DDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
4159 __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
4160 __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
4161 __Pyx_RefNannySetupContext(
"jacobi_NR_solve", 0);
4170 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error)
4171 __Pyx_GOTREF(__pyx_t_1);
4172 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 120, __pyx_L1_error)
4173 __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
4174 __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
4175 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
4176 __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
4177 __pyx_f_10csmoothers_smootherWrappersjacobi_NR_solve(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5);
4178 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4179 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4180 __pyx_t_2.memview = NULL;
4181 __pyx_t_2.data = NULL;
4182 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4183 __pyx_t_3.memview = NULL;
4184 __pyx_t_3.data = NULL;
4185 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4186 __pyx_t_4.memview = NULL;
4187 __pyx_t_4.data = NULL;
4188 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
4189 __pyx_t_5.memview = NULL;
4190 __pyx_t_5.data = NULL;
4201 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4204 __Pyx_XDECREF(__pyx_t_1);
4205 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4206 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4207 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4208 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
4209 __Pyx_AddTraceback(
"csmoothers.jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4212 __Pyx_XGIVEREF(__pyx_r);
4213 __Pyx_RefNannyFinishContext();
4225 static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_M, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
4226 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
4227 __Pyx_RefNannyDeclarations
4228 PyObject *__pyx_t_1 = NULL;
4230 Py_ssize_t __pyx_t_3;
4231 Py_ssize_t __pyx_t_4;
4232 Py_ssize_t __pyx_t_5;
4233 Py_ssize_t __pyx_t_6;
4234 __Pyx_RefNannySetupContext(
"smootherWrappersjacobi_NR_solve", 0);
4243 __pyx_v_AS.Stype = SLU_NR;
4252 __pyx_v_AS.Dtype = SLU_D;
4261 __pyx_v_AS.Mtype = SLU_GE;
4270 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error)
4271 __Pyx_GOTREF(__pyx_t_1);
4272 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L1_error)
4273 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4274 __pyx_v_AS.nrow = __pyx_t_2;
4283 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error)
4284 __Pyx_GOTREF(__pyx_t_1);
4285 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error)
4286 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4287 __pyx_v_AS.ncol = __pyx_t_2;
4296 __pyx_v_AS.Store = (&__pyx_v_sm->A);
4307 if (__pyx_t_3 < 0) {
4308 __pyx_t_3 += __pyx_v_M.shape[0];
4309 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
4310 }
else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
4311 if (unlikely(__pyx_t_2 != -1)) {
4312 __Pyx_RaiseBufferIndexError(__pyx_t_2);
4313 __PYX_ERR(0, 134, __pyx_L1_error)
4317 if (__pyx_t_4 < 0) {
4318 __pyx_t_4 += __pyx_v_R.shape[0];
4319 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
4320 }
else if (unlikely(__pyx_t_4 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
4321 if (unlikely(__pyx_t_2 != -1)) {
4322 __Pyx_RaiseBufferIndexError(__pyx_t_2);
4323 __PYX_ERR(0, 134, __pyx_L1_error)
4327 if (__pyx_t_5 < 0) {
4328 __pyx_t_5 += __pyx_v_node_order.shape[0];
4329 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
4330 }
else if (unlikely(__pyx_t_5 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
4331 if (unlikely(__pyx_t_2 != -1)) {
4332 __Pyx_RaiseBufferIndexError(__pyx_t_2);
4333 __PYX_ERR(0, 134, __pyx_L1_error)
4337 if (__pyx_t_6 < 0) {
4338 __pyx_t_6 += __pyx_v_dX.shape[0];
4339 if (unlikely(__pyx_t_6 < 0)) __pyx_t_2 = 0;
4340 }
else if (unlikely(__pyx_t_6 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
4341 if (unlikely(__pyx_t_2 != -1)) {
4342 __Pyx_RaiseBufferIndexError(__pyx_t_2);
4343 __PYX_ERR(0, 134, __pyx_L1_error)
4345 jacobi_NR_solve((&__pyx_v_AS), (&(*((
double *) ( (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))), (&(*((
double *) ( (__pyx_v_R.data + __pyx_t_4 * __pyx_v_R.strides[0]) )))), (&(*((
int *) ( (__pyx_v_node_order.data + __pyx_t_5 * __pyx_v_node_order.strides[0]) )))), (&(*((
double *) ( (__pyx_v_dX.data + __pyx_t_6 * __pyx_v_dX.strides[0]) )))));
4358 __Pyx_XDECREF(__pyx_t_1);
4359 __Pyx_WriteUnraisable(
"csmoothers.smootherWrappersjacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4361 __Pyx_RefNannyFinishContext();
4373 static PyObject *__pyx_pw_10csmoothers_5nl_jacobi_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4374 static char __pyx_doc_10csmoothers_4nl_jacobi_NR_solve[] =
"\n\n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n R : np.array double\n node_order : np.array int\n w : np.float\n tol : np.float\n dX : np.array double\n ";
4375 static PyMethodDef __pyx_mdef_10csmoothers_5nl_jacobi_NR_solve = {
"nl_jacobi_NR_solve", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_5nl_jacobi_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_4nl_jacobi_NR_solve};
4376 static PyObject *__pyx_pw_10csmoothers_5nl_jacobi_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4377 PyObject *__pyx_v_A = 0;
4378 PyObject *__pyx_v_R = 0;
4379 PyObject *__pyx_v_node_order = 0;
4380 PyObject *__pyx_v_w = 0;
4381 PyObject *__pyx_v_tol = 0;
4382 PyObject *__pyx_v_dX = 0;
4383 PyObject *__pyx_r = 0;
4384 __Pyx_RefNannyDeclarations
4385 __Pyx_RefNannySetupContext(
"nl_jacobi_NR_solve (wrapper)", 0);
4387 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_R,&__pyx_n_s_node_order,&__pyx_n_s_w,&__pyx_n_s_tol,&__pyx_n_s_dX,0};
4388 PyObject* values[6] = {0,0,0,0,0,0};
4389 if (unlikely(__pyx_kwds)) {
4391 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4393 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4395 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4397 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4399 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4401 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4403 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4406 default:
goto __pyx_L5_argtuple_error;
4408 kw_args = PyDict_Size(__pyx_kwds);
4411 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
4412 else goto __pyx_L5_argtuple_error;
4415 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
4417 __Pyx_RaiseArgtupleInvalid(
"nl_jacobi_NR_solve", 1, 6, 6, 1); __PYX_ERR(0, 136, __pyx_L3_error)
4421 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
4423 __Pyx_RaiseArgtupleInvalid(
"nl_jacobi_NR_solve", 1, 6, 6, 2); __PYX_ERR(0, 136, __pyx_L3_error)
4427 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
4429 __Pyx_RaiseArgtupleInvalid(
"nl_jacobi_NR_solve", 1, 6, 6, 3); __PYX_ERR(0, 136, __pyx_L3_error)
4433 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
4435 __Pyx_RaiseArgtupleInvalid(
"nl_jacobi_NR_solve", 1, 6, 6, 4); __PYX_ERR(0, 136, __pyx_L3_error)
4439 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
4441 __Pyx_RaiseArgtupleInvalid(
"nl_jacobi_NR_solve", 1, 6, 6, 5); __PYX_ERR(0, 136, __pyx_L3_error)
4444 if (unlikely(kw_args > 0)) {
4445 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"nl_jacobi_NR_solve") < 0)) __PYX_ERR(0, 136, __pyx_L3_error)
4447 }
else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
4448 goto __pyx_L5_argtuple_error;
4450 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4451 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4452 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4453 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4454 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4455 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4457 __pyx_v_A = values[0];
4458 __pyx_v_R = values[1];
4459 __pyx_v_node_order = values[2];
4460 __pyx_v_w = values[3];
4461 __pyx_v_tol = values[4];
4462 __pyx_v_dX = values[5];
4464 goto __pyx_L4_argument_unpacking_done;
4465 __pyx_L5_argtuple_error:;
4466 __Pyx_RaiseArgtupleInvalid(
"nl_jacobi_NR_solve", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 136, __pyx_L3_error)
4468 __Pyx_AddTraceback(
"csmoothers.nl_jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4469 __Pyx_RefNannyFinishContext();
4471 __pyx_L4_argument_unpacking_done:;
4472 __pyx_r = __pyx_pf_10csmoothers_4nl_jacobi_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_R, __pyx_v_node_order, __pyx_v_w, __pyx_v_tol, __pyx_v_dX);
4475 __Pyx_RefNannyFinishContext();
4479 static PyObject *__pyx_pf_10csmoothers_4nl_jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX) {
4480 PyObject *__pyx_r = NULL;
4481 __Pyx_RefNannyDeclarations
4482 PyObject *__pyx_t_1 = NULL;
4483 __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
4484 __pyx_t_10csmoothers_IDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
4487 __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
4488 __Pyx_RefNannySetupContext(
"nl_jacobi_NR_solve", 0);
4497 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
4498 __Pyx_GOTREF(__pyx_t_1);
4499 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 148, __pyx_L1_error)
4500 __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 148, __pyx_L1_error)
4501 __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 148, __pyx_L1_error)
4502 __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_w);
if (unlikely((__pyx_t_4 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L1_error)
4503 __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_tol);
if (unlikely((__pyx_t_5 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L1_error)
4504 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 148, __pyx_L1_error)
4505 __pyx_f_10csmoothers_smootherWrappersnl_jacobi_NR_solve(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6);
4506 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4507 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4508 __pyx_t_2.memview = NULL;
4509 __pyx_t_2.data = NULL;
4510 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4511 __pyx_t_3.memview = NULL;
4512 __pyx_t_3.data = NULL;
4513 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
4514 __pyx_t_6.memview = NULL;
4515 __pyx_t_6.data = NULL;
4526 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4529 __Pyx_XDECREF(__pyx_t_1);
4530 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4531 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4532 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
4533 __Pyx_AddTraceback(
"csmoothers.nl_jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4536 __Pyx_XGIVEREF(__pyx_r);
4537 __Pyx_RefNannyFinishContext();
4549 static void __pyx_f_10csmoothers_smootherWrappersnl_jacobi_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order,
double __pyx_v_w,
double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
4550 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
4551 __Pyx_RefNannyDeclarations
4552 PyObject *__pyx_t_1 = NULL;
4554 Py_ssize_t __pyx_t_3;
4555 Py_ssize_t __pyx_t_4;
4556 Py_ssize_t __pyx_t_5;
4557 __Pyx_RefNannySetupContext(
"smootherWrappersnl_jacobi_NR_solve", 0);
4566 __pyx_v_AS.Stype = SLU_NR;
4575 __pyx_v_AS.Dtype = SLU_D;
4584 __pyx_v_AS.Mtype = SLU_GE;
4593 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error)
4594 __Pyx_GOTREF(__pyx_t_1);
4595 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 160, __pyx_L1_error)
4596 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4597 __pyx_v_AS.nrow = __pyx_t_2;
4606 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error)
4607 __Pyx_GOTREF(__pyx_t_1);
4608 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 161, __pyx_L1_error)
4609 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4610 __pyx_v_AS.ncol = __pyx_t_2;
4619 __pyx_v_AS.Store = (&__pyx_v_sm->A);
4630 if (__pyx_t_3 < 0) {
4631 __pyx_t_3 += __pyx_v_R.shape[0];
4632 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
4633 }
else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
4634 if (unlikely(__pyx_t_2 != -1)) {
4635 __Pyx_RaiseBufferIndexError(__pyx_t_2);
4636 __PYX_ERR(0, 163, __pyx_L1_error)
4640 if (__pyx_t_4 < 0) {
4641 __pyx_t_4 += __pyx_v_node_order.shape[0];
4642 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
4643 }
else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
4644 if (unlikely(__pyx_t_2 != -1)) {
4645 __Pyx_RaiseBufferIndexError(__pyx_t_2);
4646 __PYX_ERR(0, 163, __pyx_L1_error)
4650 if (__pyx_t_5 < 0) {
4651 __pyx_t_5 += __pyx_v_dX.shape[0];
4652 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
4653 }
else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
4654 if (unlikely(__pyx_t_2 != -1)) {
4655 __Pyx_RaiseBufferIndexError(__pyx_t_2);
4656 __PYX_ERR(0, 163, __pyx_L1_error)
4658 nl_jacobi_NR_solve((&__pyx_v_AS), (&(*((
double *) ( (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), (&(*((
int *) ( (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_w, __pyx_v_tol, (&(*((
double *) ( (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))));
4671 __Pyx_XDECREF(__pyx_t_1);
4672 __Pyx_WriteUnraisable(
"csmoothers.smootherWrappersnl_jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4674 __Pyx_RefNannyFinishContext();
4686 static PyObject *__pyx_pw_10csmoothers_7gauss_seidel_NR_preare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4687 static char __pyx_doc_10csmoothers_6gauss_seidel_NR_preare[] =
"\n\n Arguments\n ---------\n A :\n w :\n tol :\n M :\n ";
4688 static PyMethodDef __pyx_mdef_10csmoothers_7gauss_seidel_NR_preare = {
"gauss_seidel_NR_preare", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_7gauss_seidel_NR_preare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_6gauss_seidel_NR_preare};
4689 static PyObject *__pyx_pw_10csmoothers_7gauss_seidel_NR_preare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4690 PyObject *__pyx_v_A = 0;
4691 PyObject *__pyx_v_w = 0;
4692 PyObject *__pyx_v_tol = 0;
4693 PyObject *__pyx_v_M = 0;
4694 PyObject *__pyx_r = 0;
4695 __Pyx_RefNannyDeclarations
4696 __Pyx_RefNannySetupContext(
"gauss_seidel_NR_preare (wrapper)", 0);
4698 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_w,&__pyx_n_s_tol,&__pyx_n_s_M,0};
4699 PyObject* values[4] = {0,0,0,0};
4700 if (unlikely(__pyx_kwds)) {
4702 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4704 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4706 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4708 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4710 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4713 default:
goto __pyx_L5_argtuple_error;
4715 kw_args = PyDict_Size(__pyx_kwds);
4718 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
4719 else goto __pyx_L5_argtuple_error;
4722 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
4724 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_preare", 1, 4, 4, 1); __PYX_ERR(0, 165, __pyx_L3_error)
4728 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
4730 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_preare", 1, 4, 4, 2); __PYX_ERR(0, 165, __pyx_L3_error)
4734 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_M)) != 0)) kw_args--;
4736 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_preare", 1, 4, 4, 3); __PYX_ERR(0, 165, __pyx_L3_error)
4739 if (unlikely(kw_args > 0)) {
4740 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"gauss_seidel_NR_preare") < 0)) __PYX_ERR(0, 165, __pyx_L3_error)
4742 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
4743 goto __pyx_L5_argtuple_error;
4745 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4746 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4747 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4748 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4750 __pyx_v_A = values[0];
4751 __pyx_v_w = values[1];
4752 __pyx_v_tol = values[2];
4753 __pyx_v_M = values[3];
4755 goto __pyx_L4_argument_unpacking_done;
4756 __pyx_L5_argtuple_error:;
4757 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_preare", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 165, __pyx_L3_error)
4759 __Pyx_AddTraceback(
"csmoothers.gauss_seidel_NR_preare", __pyx_clineno, __pyx_lineno, __pyx_filename);
4760 __Pyx_RefNannyFinishContext();
4762 __pyx_L4_argument_unpacking_done:;
4763 __pyx_r = __pyx_pf_10csmoothers_6gauss_seidel_NR_preare(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_tol, __pyx_v_M);
4766 __Pyx_RefNannyFinishContext();
4770 static PyObject *__pyx_pf_10csmoothers_6gauss_seidel_NR_preare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M) {
4771 PyObject *__pyx_r = NULL;
4772 __Pyx_RefNannyDeclarations
4773 PyObject *__pyx_t_1 = NULL;
4776 __pyx_t_10csmoothers_DDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
4777 __Pyx_RefNannySetupContext(
"gauss_seidel_NR_preare", 0);
4786 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error)
4787 __Pyx_GOTREF(__pyx_t_1);
4788 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 175, __pyx_L1_error)
4789 __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_w);
if (unlikely((__pyx_t_2 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L1_error)
4790 __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_tol);
if (unlikely((__pyx_t_3 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L1_error)
4791 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 175, __pyx_L1_error)
4792 __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_prepare(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4);
4793 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4794 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4795 __pyx_t_4.memview = NULL;
4796 __pyx_t_4.data = NULL;
4807 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4810 __Pyx_XDECREF(__pyx_t_1);
4811 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4812 __Pyx_AddTraceback(
"csmoothers.gauss_seidel_NR_preare", __pyx_clineno, __pyx_lineno, __pyx_filename);
4815 __Pyx_XGIVEREF(__pyx_r);
4816 __Pyx_RefNannyFinishContext();
4828 static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm,
double __pyx_v_w,
double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_M) {
4829 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
4830 __Pyx_RefNannyDeclarations
4831 PyObject *__pyx_t_1 = NULL;
4833 Py_ssize_t __pyx_t_3;
4834 __Pyx_RefNannySetupContext(
"smootherWrappersgauss_seidel_NR_prepare", 0);
4843 __pyx_v_AS.Stype = SLU_NR;
4852 __pyx_v_AS.Dtype = SLU_D;
4861 __pyx_v_AS.Mtype = SLU_GE;
4870 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error)
4871 __Pyx_GOTREF(__pyx_t_1);
4872 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 185, __pyx_L1_error)
4873 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4874 __pyx_v_AS.nrow = __pyx_t_2;
4883 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error)
4884 __Pyx_GOTREF(__pyx_t_1);
4885 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L1_error)
4886 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4887 __pyx_v_AS.ncol = __pyx_t_2;
4896 __pyx_v_AS.Store = (&__pyx_v_sm->A);
4907 if (__pyx_t_3 < 0) {
4908 __pyx_t_3 += __pyx_v_M.shape[0];
4909 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
4910 }
else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
4911 if (unlikely(__pyx_t_2 != -1)) {
4912 __Pyx_RaiseBufferIndexError(__pyx_t_2);
4913 __PYX_ERR(0, 188, __pyx_L1_error)
4915 gauss_seidel_NR_prepare((&__pyx_v_AS), __pyx_v_w, __pyx_v_tol, (&(*((
double *) ( (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))));
4928 __Pyx_XDECREF(__pyx_t_1);
4929 __Pyx_WriteUnraisable(
"csmoothers.smootherWrappersgauss_seidel_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4931 __Pyx_RefNannyFinishContext();
4943 static PyObject *__pyx_pw_10csmoothers_9gauss_seidel_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4944 static char __pyx_doc_10csmoothers_8gauss_seidel_NR_solve[] =
"\n\n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n M : np.array double\n R : np.array double\n node_order : np.array int\n dX : np.array double\n ";
4945 static PyMethodDef __pyx_mdef_10csmoothers_9gauss_seidel_NR_solve = {
"gauss_seidel_NR_solve", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_9gauss_seidel_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_8gauss_seidel_NR_solve};
4946 static PyObject *__pyx_pw_10csmoothers_9gauss_seidel_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4947 PyObject *__pyx_v_A = 0;
4948 PyObject *__pyx_v_M = 0;
4949 PyObject *__pyx_v_R = 0;
4950 PyObject *__pyx_v_node_order = 0;
4951 PyObject *__pyx_v_dX = 0;
4952 PyObject *__pyx_r = 0;
4953 __Pyx_RefNannyDeclarations
4954 __Pyx_RefNannySetupContext(
"gauss_seidel_NR_solve (wrapper)", 0);
4956 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_M,&__pyx_n_s_R,&__pyx_n_s_node_order,&__pyx_n_s_dX,0};
4957 PyObject* values[5] = {0,0,0,0,0};
4958 if (unlikely(__pyx_kwds)) {
4960 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4962 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4964 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4966 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4968 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4970 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4973 default:
goto __pyx_L5_argtuple_error;
4975 kw_args = PyDict_Size(__pyx_kwds);
4978 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
4979 else goto __pyx_L5_argtuple_error;
4982 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_M)) != 0)) kw_args--;
4984 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_solve", 1, 5, 5, 1); __PYX_ERR(0, 190, __pyx_L3_error)
4988 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
4990 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_solve", 1, 5, 5, 2); __PYX_ERR(0, 190, __pyx_L3_error)
4994 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
4996 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_solve", 1, 5, 5, 3); __PYX_ERR(0, 190, __pyx_L3_error)
5000 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
5002 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_solve", 1, 5, 5, 4); __PYX_ERR(0, 190, __pyx_L3_error)
5005 if (unlikely(kw_args > 0)) {
5006 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"gauss_seidel_NR_solve") < 0)) __PYX_ERR(0, 190, __pyx_L3_error)
5008 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
5009 goto __pyx_L5_argtuple_error;
5011 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5012 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5013 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5014 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5015 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5017 __pyx_v_A = values[0];
5018 __pyx_v_M = values[1];
5019 __pyx_v_R = values[2];
5020 __pyx_v_node_order = values[3];
5021 __pyx_v_dX = values[4];
5023 goto __pyx_L4_argument_unpacking_done;
5024 __pyx_L5_argtuple_error:;
5025 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_solve", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 190, __pyx_L3_error)
5027 __Pyx_AddTraceback(
"csmoothers.gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5028 __Pyx_RefNannyFinishContext();
5030 __pyx_L4_argument_unpacking_done:;
5031 __pyx_r = __pyx_pf_10csmoothers_8gauss_seidel_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_M, __pyx_v_R, __pyx_v_node_order, __pyx_v_dX);
5034 __Pyx_RefNannyFinishContext();
5038 static PyObject *__pyx_pf_10csmoothers_8gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX) {
5039 PyObject *__pyx_r = NULL;
5040 __Pyx_RefNannyDeclarations
5041 PyObject *__pyx_t_1 = NULL;
5042 __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
5043 __pyx_t_10csmoothers_DDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
5044 __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
5045 __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
5046 __Pyx_RefNannySetupContext(
"gauss_seidel_NR_solve", 0);
5055 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error)
5056 __Pyx_GOTREF(__pyx_t_1);
5057 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 201, __pyx_L1_error)
5058 __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 201, __pyx_L1_error)
5059 __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 201, __pyx_L1_error)
5060 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 201, __pyx_L1_error)
5061 __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 201, __pyx_L1_error)
5062 __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_solve(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5);
5063 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5064 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5065 __pyx_t_2.memview = NULL;
5066 __pyx_t_2.data = NULL;
5067 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
5068 __pyx_t_3.memview = NULL;
5069 __pyx_t_3.data = NULL;
5070 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
5071 __pyx_t_4.memview = NULL;
5072 __pyx_t_4.data = NULL;
5073 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
5074 __pyx_t_5.memview = NULL;
5075 __pyx_t_5.data = NULL;
5086 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5089 __Pyx_XDECREF(__pyx_t_1);
5090 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5091 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
5092 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
5093 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
5094 __Pyx_AddTraceback(
"csmoothers.gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5097 __Pyx_XGIVEREF(__pyx_r);
5098 __Pyx_RefNannyFinishContext();
5110 static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_M, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
5111 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
5112 __Pyx_RefNannyDeclarations
5113 PyObject *__pyx_t_1 = NULL;
5115 Py_ssize_t __pyx_t_3;
5116 Py_ssize_t __pyx_t_4;
5117 Py_ssize_t __pyx_t_5;
5118 Py_ssize_t __pyx_t_6;
5119 __Pyx_RefNannySetupContext(
"smootherWrappersgauss_seidel_NR_solve", 0);
5128 __pyx_v_AS.Stype = SLU_NR;
5137 __pyx_v_AS.Dtype = SLU_D;
5146 __pyx_v_AS.Mtype = SLU_GE;
5155 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error)
5156 __Pyx_GOTREF(__pyx_t_1);
5157 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L1_error)
5158 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5159 __pyx_v_AS.nrow = __pyx_t_2;
5168 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error)
5169 __Pyx_GOTREF(__pyx_t_1);
5170 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 213, __pyx_L1_error)
5171 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5172 __pyx_v_AS.ncol = __pyx_t_2;
5181 __pyx_v_AS.Store = (&__pyx_v_sm->A);
5192 if (__pyx_t_3 < 0) {
5193 __pyx_t_3 += __pyx_v_M.shape[0];
5194 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
5195 }
else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
5196 if (unlikely(__pyx_t_2 != -1)) {
5197 __Pyx_RaiseBufferIndexError(__pyx_t_2);
5198 __PYX_ERR(0, 215, __pyx_L1_error)
5202 if (__pyx_t_4 < 0) {
5203 __pyx_t_4 += __pyx_v_R.shape[0];
5204 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
5205 }
else if (unlikely(__pyx_t_4 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
5206 if (unlikely(__pyx_t_2 != -1)) {
5207 __Pyx_RaiseBufferIndexError(__pyx_t_2);
5208 __PYX_ERR(0, 215, __pyx_L1_error)
5212 if (__pyx_t_5 < 0) {
5213 __pyx_t_5 += __pyx_v_node_order.shape[0];
5214 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
5215 }
else if (unlikely(__pyx_t_5 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
5216 if (unlikely(__pyx_t_2 != -1)) {
5217 __Pyx_RaiseBufferIndexError(__pyx_t_2);
5218 __PYX_ERR(0, 215, __pyx_L1_error)
5222 if (__pyx_t_6 < 0) {
5223 __pyx_t_6 += __pyx_v_dX.shape[0];
5224 if (unlikely(__pyx_t_6 < 0)) __pyx_t_2 = 0;
5225 }
else if (unlikely(__pyx_t_6 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
5226 if (unlikely(__pyx_t_2 != -1)) {
5227 __Pyx_RaiseBufferIndexError(__pyx_t_2);
5228 __PYX_ERR(0, 215, __pyx_L1_error)
5230 gauss_seidel_NR_solve((&__pyx_v_AS), (&(*((
double *) ( (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))), (&(*((
double *) ( (__pyx_v_R.data + __pyx_t_4 * __pyx_v_R.strides[0]) )))), (&(*((
int *) ( (__pyx_v_node_order.data + __pyx_t_5 * __pyx_v_node_order.strides[0]) )))), (&(*((
double *) ( (__pyx_v_dX.data + __pyx_t_6 * __pyx_v_dX.strides[0]) )))));
5243 __Pyx_XDECREF(__pyx_t_1);
5244 __Pyx_WriteUnraisable(
"csmoothers.smootherWrappersgauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
5246 __Pyx_RefNannyFinishContext();
5258 static PyObject *__pyx_pw_10csmoothers_11nl_gauss_seidel_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5259 static char __pyx_doc_10csmoothers_10nl_gauss_seidel_NR_solve[] =
"\n \n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n R : np.array double\n node_order : np.array int\n w : double\n tol : double\n dX : np.array double\n ";
5260 static PyMethodDef __pyx_mdef_10csmoothers_11nl_gauss_seidel_NR_solve = {
"nl_gauss_seidel_NR_solve", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_11nl_gauss_seidel_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_10nl_gauss_seidel_NR_solve};
5261 static PyObject *__pyx_pw_10csmoothers_11nl_gauss_seidel_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5262 PyObject *__pyx_v_A = 0;
5263 PyObject *__pyx_v_R = 0;
5264 PyObject *__pyx_v_node_order = 0;
5265 PyObject *__pyx_v_w = 0;
5266 PyObject *__pyx_v_tol = 0;
5267 PyObject *__pyx_v_dX = 0;
5268 PyObject *__pyx_r = 0;
5269 __Pyx_RefNannyDeclarations
5270 __Pyx_RefNannySetupContext(
"nl_gauss_seidel_NR_solve (wrapper)", 0);
5272 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_R,&__pyx_n_s_node_order,&__pyx_n_s_w,&__pyx_n_s_tol,&__pyx_n_s_dX,0};
5273 PyObject* values[6] = {0,0,0,0,0,0};
5274 if (unlikely(__pyx_kwds)) {
5276 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5278 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5280 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5282 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5284 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5286 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5288 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5291 default:
goto __pyx_L5_argtuple_error;
5293 kw_args = PyDict_Size(__pyx_kwds);
5296 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
5297 else goto __pyx_L5_argtuple_error;
5300 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
5302 __Pyx_RaiseArgtupleInvalid(
"nl_gauss_seidel_NR_solve", 1, 6, 6, 1); __PYX_ERR(0, 217, __pyx_L3_error)
5306 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
5308 __Pyx_RaiseArgtupleInvalid(
"nl_gauss_seidel_NR_solve", 1, 6, 6, 2); __PYX_ERR(0, 217, __pyx_L3_error)
5312 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
5314 __Pyx_RaiseArgtupleInvalid(
"nl_gauss_seidel_NR_solve", 1, 6, 6, 3); __PYX_ERR(0, 217, __pyx_L3_error)
5318 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
5320 __Pyx_RaiseArgtupleInvalid(
"nl_gauss_seidel_NR_solve", 1, 6, 6, 4); __PYX_ERR(0, 217, __pyx_L3_error)
5324 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
5326 __Pyx_RaiseArgtupleInvalid(
"nl_gauss_seidel_NR_solve", 1, 6, 6, 5); __PYX_ERR(0, 217, __pyx_L3_error)
5329 if (unlikely(kw_args > 0)) {
5330 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"nl_gauss_seidel_NR_solve") < 0)) __PYX_ERR(0, 217, __pyx_L3_error)
5332 }
else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
5333 goto __pyx_L5_argtuple_error;
5335 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5336 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5337 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5338 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5339 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5340 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5342 __pyx_v_A = values[0];
5343 __pyx_v_R = values[1];
5344 __pyx_v_node_order = values[2];
5345 __pyx_v_w = values[3];
5346 __pyx_v_tol = values[4];
5347 __pyx_v_dX = values[5];
5349 goto __pyx_L4_argument_unpacking_done;
5350 __pyx_L5_argtuple_error:;
5351 __Pyx_RaiseArgtupleInvalid(
"nl_gauss_seidel_NR_solve", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 217, __pyx_L3_error)
5353 __Pyx_AddTraceback(
"csmoothers.nl_gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5354 __Pyx_RefNannyFinishContext();
5356 __pyx_L4_argument_unpacking_done:;
5357 __pyx_r = __pyx_pf_10csmoothers_10nl_gauss_seidel_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_R, __pyx_v_node_order, __pyx_v_w, __pyx_v_tol, __pyx_v_dX);
5360 __Pyx_RefNannyFinishContext();
5364 static PyObject *__pyx_pf_10csmoothers_10nl_gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX) {
5365 PyObject *__pyx_r = NULL;
5366 __Pyx_RefNannyDeclarations
5367 PyObject *__pyx_t_1 = NULL;
5368 __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
5369 __pyx_t_10csmoothers_IDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
5372 __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
5373 PyObject *__pyx_t_7 = NULL;
5374 __Pyx_RefNannySetupContext(
"nl_gauss_seidel_NR_solve", 0);
5383 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
5384 __Pyx_GOTREF(__pyx_t_1);
5385 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 229, __pyx_L1_error)
5394 __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 230, __pyx_L1_error)
5403 __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 231, __pyx_L1_error)
5412 __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_w);
if (unlikely((__pyx_t_4 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 232, __pyx_L1_error)
5421 __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_tol);
if (unlikely((__pyx_t_5 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 233, __pyx_L1_error)
5430 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 234, __pyx_L1_error)
5439 __pyx_t_7 = __pyx_f_10csmoothers_smootherWrappers_nl_gauss_seidel_NR_solve(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 229, __pyx_L1_error)
5440 __Pyx_GOTREF(__pyx_t_7);
5441 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5442 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5443 __pyx_t_2.memview = NULL;
5444 __pyx_t_2.data = NULL;
5445 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
5446 __pyx_t_3.memview = NULL;
5447 __pyx_t_3.data = NULL;
5448 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5449 __pyx_t_6.memview = NULL;
5450 __pyx_t_6.data = NULL;
5451 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5462 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5465 __Pyx_XDECREF(__pyx_t_1);
5466 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5467 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
5468 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5469 __Pyx_XDECREF(__pyx_t_7);
5470 __Pyx_AddTraceback(
"csmoothers.nl_gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5473 __Pyx_XGIVEREF(__pyx_r);
5474 __Pyx_RefNannyFinishContext();
5486 static PyObject *__pyx_f_10csmoothers_smootherWrappers_nl_gauss_seidel_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order,
double __pyx_v_w,
double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
5487 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
5488 PyObject *__pyx_r = NULL;
5489 __Pyx_RefNannyDeclarations
5490 PyObject *__pyx_t_1 = NULL;
5492 Py_ssize_t __pyx_t_3;
5493 Py_ssize_t __pyx_t_4;
5494 Py_ssize_t __pyx_t_5;
5495 __Pyx_RefNannySetupContext(
"smootherWrappers_nl_gauss_seidel_NR_solve", 0);
5504 __pyx_v_AS.Stype = SLU_NR;
5513 __pyx_v_AS.Dtype = SLU_D;
5522 __pyx_v_AS.Mtype = SLU_GE;
5531 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error)
5532 __Pyx_GOTREF(__pyx_t_1);
5533 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 246, __pyx_L1_error)
5534 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5535 __pyx_v_AS.nrow = __pyx_t_2;
5544 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error)
5545 __Pyx_GOTREF(__pyx_t_1);
5546 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 247, __pyx_L1_error)
5547 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5548 __pyx_v_AS.ncol = __pyx_t_2;
5557 __pyx_v_AS.Store = (&__pyx_v_sm->A);
5568 if (__pyx_t_3 < 0) {
5569 __pyx_t_3 += __pyx_v_R.shape[0];
5570 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
5571 }
else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
5572 if (unlikely(__pyx_t_2 != -1)) {
5573 __Pyx_RaiseBufferIndexError(__pyx_t_2);
5574 __PYX_ERR(0, 249, __pyx_L1_error)
5578 if (__pyx_t_4 < 0) {
5579 __pyx_t_4 += __pyx_v_node_order.shape[0];
5580 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
5581 }
else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
5582 if (unlikely(__pyx_t_2 != -1)) {
5583 __Pyx_RaiseBufferIndexError(__pyx_t_2);
5584 __PYX_ERR(0, 249, __pyx_L1_error)
5588 if (__pyx_t_5 < 0) {
5589 __pyx_t_5 += __pyx_v_dX.shape[0];
5590 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
5591 }
else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
5592 if (unlikely(__pyx_t_2 != -1)) {
5593 __Pyx_RaiseBufferIndexError(__pyx_t_2);
5594 __PYX_ERR(0, 249, __pyx_L1_error)
5596 nl_gauss_seidel_NR_solve((&__pyx_v_AS), (&(*((
double *) ( (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), (&(*((
int *) ( (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_w, __pyx_v_tol, (&(*((
double *) ( (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))));
5607 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5610 __Pyx_XDECREF(__pyx_t_1);
5611 __Pyx_AddTraceback(
"csmoothers.smootherWrappers_nl_gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5614 __Pyx_XGIVEREF(__pyx_r);
5615 __Pyx_RefNannyFinishContext();
5628 static PyObject *__pyx_pw_10csmoothers_13asm_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5629 static char __pyx_doc_10csmoothers_12asm_NR_prepare[] =
"\n\n Arguments\n ---------\n A :\n asmFactor :\n ";
5630 static PyMethodDef __pyx_mdef_10csmoothers_13asm_NR_prepare = {
"asm_NR_prepare", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_13asm_NR_prepare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_12asm_NR_prepare};
5631 static PyObject *__pyx_pw_10csmoothers_13asm_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5632 PyObject *__pyx_v_A = 0;
5633 PyObject *__pyx_v_asmFactor = 0;
5634 PyObject *__pyx_r = 0;
5635 __Pyx_RefNannyDeclarations
5636 __Pyx_RefNannySetupContext(
"asm_NR_prepare (wrapper)", 0);
5638 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_asmFactor,0};
5639 PyObject* values[2] = {0,0};
5640 if (unlikely(__pyx_kwds)) {
5642 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5644 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5646 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5649 default:
goto __pyx_L5_argtuple_error;
5651 kw_args = PyDict_Size(__pyx_kwds);
5654 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
5655 else goto __pyx_L5_argtuple_error;
5658 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_asmFactor)) != 0)) kw_args--;
5660 __Pyx_RaiseArgtupleInvalid(
"asm_NR_prepare", 1, 2, 2, 1); __PYX_ERR(0, 251, __pyx_L3_error)
5663 if (unlikely(kw_args > 0)) {
5664 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"asm_NR_prepare") < 0)) __PYX_ERR(0, 251, __pyx_L3_error)
5666 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5667 goto __pyx_L5_argtuple_error;
5669 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5670 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5672 __pyx_v_A = values[0];
5673 __pyx_v_asmFactor = values[1];
5675 goto __pyx_L4_argument_unpacking_done;
5676 __pyx_L5_argtuple_error:;
5677 __Pyx_RaiseArgtupleInvalid(
"asm_NR_prepare", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 251, __pyx_L3_error)
5679 __Pyx_AddTraceback(
"csmoothers.asm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5680 __Pyx_RefNannyFinishContext();
5682 __pyx_L4_argument_unpacking_done:;
5683 __pyx_r = __pyx_pf_10csmoothers_12asm_NR_prepare(__pyx_self, __pyx_v_A, __pyx_v_asmFactor);
5686 __Pyx_RefNannyFinishContext();
5690 static PyObject *__pyx_pf_10csmoothers_12asm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_asmFactor) {
5691 PyObject *__pyx_r = NULL;
5692 __Pyx_RefNannyDeclarations
5693 PyObject *__pyx_t_1 = NULL;
5694 PyObject *__pyx_t_2 = NULL;
5695 __Pyx_RefNannySetupContext(
"asm_NR_prepare", 0);
5704 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error)
5705 __Pyx_GOTREF(__pyx_t_1);
5706 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 259, __pyx_L1_error)
5715 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_asmFactor, __pyx_n_s_cASMFactor);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error)
5716 __Pyx_GOTREF(__pyx_t_2);
5717 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10csmoothers_cASMFactor))))) __PYX_ERR(0, 260, __pyx_L1_error)
5726 __pyx_f_10csmoothers_smootherWrappers_asm_NR_prepare(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), ((
struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_t_2));
5727 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5728 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5739 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5742 __Pyx_XDECREF(__pyx_t_1);
5743 __Pyx_XDECREF(__pyx_t_2);
5744 __Pyx_AddTraceback(
"csmoothers.asm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5747 __Pyx_XGIVEREF(__pyx_r);
5748 __Pyx_RefNannyFinishContext();
5760 static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm,
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_asmFactor) {
5761 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
5762 __Pyx_RefNannyDeclarations
5763 PyObject *__pyx_t_1 = NULL;
5765 __Pyx_RefNannySetupContext(
"smootherWrappers_asm_NR_prepare", 0);
5774 __pyx_v_AS.Stype = SLU_NR;
5783 __pyx_v_AS.Dtype = SLU_D;
5792 __pyx_v_AS.Mtype = SLU_GE;
5801 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error)
5802 __Pyx_GOTREF(__pyx_t_1);
5803 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 268, __pyx_L1_error)
5804 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5805 __pyx_v_AS.nrow = __pyx_t_2;
5814 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error)
5815 __Pyx_GOTREF(__pyx_t_1);
5816 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 269, __pyx_L1_error)
5817 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5818 __pyx_v_AS.ncol = __pyx_t_2;
5827 __pyx_v_AS.Store = (&__pyx_v_sm->A);
5836 asm_NR_prepare((&__pyx_v_AS), __pyx_v_asmFactor->subdomain_dim, __pyx_v_asmFactor->l2g_L, __pyx_v_asmFactor->subdomain_L, __pyx_v_asmFactor->subdomain_pivots);
5849 __Pyx_XDECREF(__pyx_t_1);
5850 __Pyx_WriteUnraisable(
"csmoothers.smootherWrappers_asm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
5852 __Pyx_RefNannyFinishContext();
5864 static PyObject *__pyx_pw_10csmoothers_15asm_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5865 static char __pyx_doc_10csmoothers_14asm_NR_solve[] =
"\n \n Arguments\n ---------\n A : superluWrappers.sparseMatrix\n w : double\n asmFactor : csmoothers.asmFactor\n node_order : np.array int\n R : np.array double\n dX : np.array double\n ";
5866 static PyMethodDef __pyx_mdef_10csmoothers_15asm_NR_solve = {
"asm_NR_solve", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_15asm_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_14asm_NR_solve};
5867 static PyObject *__pyx_pw_10csmoothers_15asm_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5868 PyObject *__pyx_v_A = 0;
5869 PyObject *__pyx_v_w = 0;
5870 PyObject *__pyx_v_asmFactor = 0;
5871 PyObject *__pyx_v_node_order = 0;
5872 PyObject *__pyx_v_R = 0;
5873 PyObject *__pyx_v_dX = 0;
5874 PyObject *__pyx_r = 0;
5875 __Pyx_RefNannyDeclarations
5876 __Pyx_RefNannySetupContext(
"asm_NR_solve (wrapper)", 0);
5878 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_w,&__pyx_n_s_asmFactor,&__pyx_n_s_node_order,&__pyx_n_s_R,&__pyx_n_s_dX,0};
5879 PyObject* values[6] = {0,0,0,0,0,0};
5880 if (unlikely(__pyx_kwds)) {
5882 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5884 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5886 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5888 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5890 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5892 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5894 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5897 default:
goto __pyx_L5_argtuple_error;
5899 kw_args = PyDict_Size(__pyx_kwds);
5902 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
5903 else goto __pyx_L5_argtuple_error;
5906 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
5908 __Pyx_RaiseArgtupleInvalid(
"asm_NR_solve", 1, 6, 6, 1); __PYX_ERR(0, 277, __pyx_L3_error)
5912 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_asmFactor)) != 0)) kw_args--;
5914 __Pyx_RaiseArgtupleInvalid(
"asm_NR_solve", 1, 6, 6, 2); __PYX_ERR(0, 277, __pyx_L3_error)
5918 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
5920 __Pyx_RaiseArgtupleInvalid(
"asm_NR_solve", 1, 6, 6, 3); __PYX_ERR(0, 277, __pyx_L3_error)
5924 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
5926 __Pyx_RaiseArgtupleInvalid(
"asm_NR_solve", 1, 6, 6, 4); __PYX_ERR(0, 277, __pyx_L3_error)
5930 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
5932 __Pyx_RaiseArgtupleInvalid(
"asm_NR_solve", 1, 6, 6, 5); __PYX_ERR(0, 277, __pyx_L3_error)
5935 if (unlikely(kw_args > 0)) {
5936 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"asm_NR_solve") < 0)) __PYX_ERR(0, 277, __pyx_L3_error)
5938 }
else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
5939 goto __pyx_L5_argtuple_error;
5941 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5942 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5943 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5944 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5945 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5946 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5948 __pyx_v_A = values[0];
5949 __pyx_v_w = values[1];
5950 __pyx_v_asmFactor = values[2];
5951 __pyx_v_node_order = values[3];
5952 __pyx_v_R = values[4];
5953 __pyx_v_dX = values[5];
5955 goto __pyx_L4_argument_unpacking_done;
5956 __pyx_L5_argtuple_error:;
5957 __Pyx_RaiseArgtupleInvalid(
"asm_NR_solve", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 277, __pyx_L3_error)
5959 __Pyx_AddTraceback(
"csmoothers.asm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5960 __Pyx_RefNannyFinishContext();
5962 __pyx_L4_argument_unpacking_done:;
5963 __pyx_r = __pyx_pf_10csmoothers_14asm_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_asmFactor, __pyx_v_node_order, __pyx_v_R, __pyx_v_dX);
5966 __Pyx_RefNannyFinishContext();
5970 static PyObject *__pyx_pf_10csmoothers_14asm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_asmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX) {
5971 PyObject *__pyx_r = NULL;
5972 __Pyx_RefNannyDeclarations
5973 PyObject *__pyx_t_1 = NULL;
5975 PyObject *__pyx_t_3 = NULL;
5976 __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
5977 __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
5978 __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
5979 __Pyx_RefNannySetupContext(
"asm_NR_solve", 0);
5988 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 289, __pyx_L1_error)
5989 __Pyx_GOTREF(__pyx_t_1);
5990 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 289, __pyx_L1_error)
5999 __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_w);
if (unlikely((__pyx_t_2 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 290, __pyx_L1_error)
6008 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_asmFactor, __pyx_n_s_cASMFactor);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 291, __pyx_L1_error)
6009 __Pyx_GOTREF(__pyx_t_3);
6010 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_10csmoothers_cASMFactor))))) __PYX_ERR(0, 291, __pyx_L1_error)
6019 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 292, __pyx_L1_error)
6028 __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 293, __pyx_L1_error)
6037 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 294, __pyx_L1_error)
6046 __pyx_f_10csmoothers_smootherWrappers_asm_NR_solve(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, ((
struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_t_3), __pyx_t_4, __pyx_t_5, __pyx_t_6);
6047 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6048 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6049 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
6050 __pyx_t_4.memview = NULL;
6051 __pyx_t_4.data = NULL;
6052 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
6053 __pyx_t_5.memview = NULL;
6054 __pyx_t_5.data = NULL;
6055 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6056 __pyx_t_6.memview = NULL;
6057 __pyx_t_6.data = NULL;
6068 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6071 __Pyx_XDECREF(__pyx_t_1);
6072 __Pyx_XDECREF(__pyx_t_3);
6073 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
6074 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
6075 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6076 __Pyx_AddTraceback(
"csmoothers.asm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
6079 __Pyx_XGIVEREF(__pyx_r);
6080 __Pyx_RefNannyFinishContext();
6092 static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm,
double __pyx_v_w,
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_asmFactor, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
6093 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
6094 __Pyx_RefNannyDeclarations
6095 PyObject *__pyx_t_1 = NULL;
6097 Py_ssize_t __pyx_t_3;
6098 Py_ssize_t __pyx_t_4;
6099 Py_ssize_t __pyx_t_5;
6100 __Pyx_RefNannySetupContext(
"smootherWrappers_asm_NR_solve", 0);
6109 __pyx_v_AS.Stype = SLU_NR;
6118 __pyx_v_AS.Dtype = SLU_D;
6127 __pyx_v_AS.Mtype = SLU_GE;
6136 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L1_error)
6137 __Pyx_GOTREF(__pyx_t_1);
6138 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 306, __pyx_L1_error)
6139 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6140 __pyx_v_AS.nrow = __pyx_t_2;
6149 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error)
6150 __Pyx_GOTREF(__pyx_t_1);
6151 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 307, __pyx_L1_error)
6152 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6153 __pyx_v_AS.ncol = __pyx_t_2;
6162 __pyx_v_AS.Store = (&__pyx_v_sm->A);
6173 if (__pyx_t_3 < 0) {
6174 __pyx_t_3 += __pyx_v_R.shape[0];
6175 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
6176 }
else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
6177 if (unlikely(__pyx_t_2 != -1)) {
6178 __Pyx_RaiseBufferIndexError(__pyx_t_2);
6179 __PYX_ERR(0, 314, __pyx_L1_error)
6191 if (__pyx_t_4 < 0) {
6192 __pyx_t_4 += __pyx_v_node_order.shape[0];
6193 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
6194 }
else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
6195 if (unlikely(__pyx_t_2 != -1)) {
6196 __Pyx_RaiseBufferIndexError(__pyx_t_2);
6197 __PYX_ERR(0, 316, __pyx_L1_error)
6209 if (__pyx_t_5 < 0) {
6210 __pyx_t_5 += __pyx_v_dX.shape[0];
6211 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
6212 }
else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
6213 if (unlikely(__pyx_t_2 != -1)) {
6214 __Pyx_RaiseBufferIndexError(__pyx_t_2);
6215 __PYX_ERR(0, 318, __pyx_L1_error)
6225 asm_NR_solve((&__pyx_v_AS), __pyx_v_w, __pyx_v_asmFactor->subdomain_L, __pyx_v_asmFactor->subdomain_dim, __pyx_v_asmFactor->l2g_L, (&(*((
double *) ( (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), __pyx_v_asmFactor->subdomain_R, (&(*((
int *) ( (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_asmFactor->subdomain_dX, (&(*((
double *) ( (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))), __pyx_v_asmFactor->subdomain_pivots);
6238 __Pyx_XDECREF(__pyx_t_1);
6239 __Pyx_WriteUnraisable(
"csmoothers.smootherWrappers_asm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6241 __Pyx_RefNannyFinishContext();
6253 static PyObject *__pyx_pw_10csmoothers_17basm_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6254 static char __pyx_doc_10csmoothers_16basm_NR_prepare[] =
"\n\n Arguments\n ---------\n A :\n basmFactor :\n ";
6255 static PyMethodDef __pyx_mdef_10csmoothers_17basm_NR_prepare = {
"basm_NR_prepare", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_17basm_NR_prepare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_16basm_NR_prepare};
6256 static PyObject *__pyx_pw_10csmoothers_17basm_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6257 PyObject *__pyx_v_A = 0;
6258 PyObject *__pyx_v_basmFactor = 0;
6259 PyObject *__pyx_r = 0;
6260 __Pyx_RefNannyDeclarations
6261 __Pyx_RefNannySetupContext(
"basm_NR_prepare (wrapper)", 0);
6263 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_basmFactor,0};
6264 PyObject* values[2] = {0,0};
6265 if (unlikely(__pyx_kwds)) {
6267 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6269 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6271 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6274 default:
goto __pyx_L5_argtuple_error;
6276 kw_args = PyDict_Size(__pyx_kwds);
6279 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
6280 else goto __pyx_L5_argtuple_error;
6283 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_basmFactor)) != 0)) kw_args--;
6285 __Pyx_RaiseArgtupleInvalid(
"basm_NR_prepare", 1, 2, 2, 1); __PYX_ERR(0, 321, __pyx_L3_error)
6288 if (unlikely(kw_args > 0)) {
6289 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"basm_NR_prepare") < 0)) __PYX_ERR(0, 321, __pyx_L3_error)
6291 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
6292 goto __pyx_L5_argtuple_error;
6294 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6295 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6297 __pyx_v_A = values[0];
6298 __pyx_v_basmFactor = values[1];
6300 goto __pyx_L4_argument_unpacking_done;
6301 __pyx_L5_argtuple_error:;
6302 __Pyx_RaiseArgtupleInvalid(
"basm_NR_prepare", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 321, __pyx_L3_error)
6304 __Pyx_AddTraceback(
"csmoothers.basm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
6305 __Pyx_RefNannyFinishContext();
6307 __pyx_L4_argument_unpacking_done:;
6308 __pyx_r = __pyx_pf_10csmoothers_16basm_NR_prepare(__pyx_self, __pyx_v_A, __pyx_v_basmFactor);
6311 __Pyx_RefNannyFinishContext();
6315 static PyObject *__pyx_pf_10csmoothers_16basm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_basmFactor) {
6316 PyObject *__pyx_r = NULL;
6317 __Pyx_RefNannyDeclarations
6318 PyObject *__pyx_t_1 = NULL;
6319 PyObject *__pyx_t_2 = NULL;
6320 __Pyx_RefNannySetupContext(
"basm_NR_prepare", 0);
6329 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error)
6330 __Pyx_GOTREF(__pyx_t_1);
6331 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 329, __pyx_L1_error)
6340 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_basmFactor, __pyx_n_s_cBASMFactor);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L1_error)
6341 __Pyx_GOTREF(__pyx_t_2);
6342 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10csmoothers_cBASMFactor))))) __PYX_ERR(0, 330, __pyx_L1_error)
6351 __pyx_f_10csmoothers_smootherWrappers_basm_NR_prepare(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), ((
struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_t_2));
6352 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6353 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6364 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6367 __Pyx_XDECREF(__pyx_t_1);
6368 __Pyx_XDECREF(__pyx_t_2);
6369 __Pyx_AddTraceback(
"csmoothers.basm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
6372 __Pyx_XGIVEREF(__pyx_r);
6373 __Pyx_RefNannyFinishContext();
6385 static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm,
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_basmFactor) {
6386 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
6387 __Pyx_RefNannyDeclarations
6388 PyObject *__pyx_t_1 = NULL;
6390 __Pyx_RefNannySetupContext(
"smootherWrappers_basm_NR_prepare", 0);
6399 __pyx_v_AS.Dtype = SLU_D;
6408 __pyx_v_AS.Mtype = SLU_GE;
6417 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
6418 __Pyx_GOTREF(__pyx_t_1);
6419 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L1_error)
6420 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6421 __pyx_v_AS.nrow = __pyx_t_2;
6430 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 338, __pyx_L1_error)
6431 __Pyx_GOTREF(__pyx_t_1);
6432 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L1_error)
6433 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6434 __pyx_v_AS.ncol = __pyx_t_2;
6443 __pyx_v_AS.Store = (&__pyx_v_sm->A);
6452 basm_NR_prepare(__pyx_v_basmFactor->bs, __pyx_v_basmFactor->N, (&__pyx_v_AS), __pyx_v_basmFactor->subdomain_dim, __pyx_v_basmFactor->l2g_L, __pyx_v_basmFactor->subdomain_L, __pyx_v_basmFactor->subdomain_pivots, __pyx_v_basmFactor->subdomain_col_pivots);
6465 __Pyx_XDECREF(__pyx_t_1);
6466 __Pyx_WriteUnraisable(
"csmoothers.smootherWrappers_basm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6468 __Pyx_RefNannyFinishContext();
6480 static PyObject *__pyx_pw_10csmoothers_19basm_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6481 static char __pyx_doc_10csmoothers_18basm_NR_solve[] =
"\n \n Arguments\n ---------\n A :\n w :\n basmFactor :\n node_order :\n R :\n dX :\n ";
6482 static PyMethodDef __pyx_mdef_10csmoothers_19basm_NR_solve = {
"basm_NR_solve", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_19basm_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_18basm_NR_solve};
6483 static PyObject *__pyx_pw_10csmoothers_19basm_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6484 PyObject *__pyx_v_A = 0;
6485 PyObject *__pyx_v_w = 0;
6486 PyObject *__pyx_v_basmFactor = 0;
6487 PyObject *__pyx_v_node_order = 0;
6488 PyObject *__pyx_v_R = 0;
6489 PyObject *__pyx_v_dX = 0;
6490 PyObject *__pyx_r = 0;
6491 __Pyx_RefNannyDeclarations
6492 __Pyx_RefNannySetupContext(
"basm_NR_solve (wrapper)", 0);
6494 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_w,&__pyx_n_s_basmFactor,&__pyx_n_s_node_order,&__pyx_n_s_R,&__pyx_n_s_dX,0};
6495 PyObject* values[6] = {0,0,0,0,0,0};
6496 if (unlikely(__pyx_kwds)) {
6498 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6500 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6502 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6504 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6506 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6508 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6510 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6513 default:
goto __pyx_L5_argtuple_error;
6515 kw_args = PyDict_Size(__pyx_kwds);
6518 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
6519 else goto __pyx_L5_argtuple_error;
6522 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
6524 __Pyx_RaiseArgtupleInvalid(
"basm_NR_solve", 1, 6, 6, 1); __PYX_ERR(0, 350, __pyx_L3_error)
6528 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_basmFactor)) != 0)) kw_args--;
6530 __Pyx_RaiseArgtupleInvalid(
"basm_NR_solve", 1, 6, 6, 2); __PYX_ERR(0, 350, __pyx_L3_error)
6534 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
6536 __Pyx_RaiseArgtupleInvalid(
"basm_NR_solve", 1, 6, 6, 3); __PYX_ERR(0, 350, __pyx_L3_error)
6540 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
6542 __Pyx_RaiseArgtupleInvalid(
"basm_NR_solve", 1, 6, 6, 4); __PYX_ERR(0, 350, __pyx_L3_error)
6546 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
6548 __Pyx_RaiseArgtupleInvalid(
"basm_NR_solve", 1, 6, 6, 5); __PYX_ERR(0, 350, __pyx_L3_error)
6551 if (unlikely(kw_args > 0)) {
6552 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"basm_NR_solve") < 0)) __PYX_ERR(0, 350, __pyx_L3_error)
6554 }
else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
6555 goto __pyx_L5_argtuple_error;
6557 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6558 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6559 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6560 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6561 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6562 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6564 __pyx_v_A = values[0];
6565 __pyx_v_w = values[1];
6566 __pyx_v_basmFactor = values[2];
6567 __pyx_v_node_order = values[3];
6568 __pyx_v_R = values[4];
6569 __pyx_v_dX = values[5];
6571 goto __pyx_L4_argument_unpacking_done;
6572 __pyx_L5_argtuple_error:;
6573 __Pyx_RaiseArgtupleInvalid(
"basm_NR_solve", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 350, __pyx_L3_error)
6575 __Pyx_AddTraceback(
"csmoothers.basm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
6576 __Pyx_RefNannyFinishContext();
6578 __pyx_L4_argument_unpacking_done:;
6579 __pyx_r = __pyx_pf_10csmoothers_18basm_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_basmFactor, __pyx_v_node_order, __pyx_v_R, __pyx_v_dX);
6582 __Pyx_RefNannyFinishContext();
6586 static PyObject *__pyx_pf_10csmoothers_18basm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_basmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX) {
6587 PyObject *__pyx_r = NULL;
6588 __Pyx_RefNannyDeclarations
6589 PyObject *__pyx_t_1 = NULL;
6591 PyObject *__pyx_t_3 = NULL;
6592 __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
6593 __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
6594 __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
6595 __Pyx_RefNannySetupContext(
"basm_NR_solve", 0);
6604 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error)
6605 __Pyx_GOTREF(__pyx_t_1);
6606 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 362, __pyx_L1_error)
6615 __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_w);
if (unlikely((__pyx_t_2 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L1_error)
6624 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_basmFactor, __pyx_n_s_cBASMFactor);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 364, __pyx_L1_error)
6625 __Pyx_GOTREF(__pyx_t_3);
6626 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_10csmoothers_cBASMFactor))))) __PYX_ERR(0, 364, __pyx_L1_error)
6635 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 365, __pyx_L1_error)
6644 __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 366, __pyx_L1_error)
6653 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 367, __pyx_L1_error)
6662 __pyx_f_10csmoothers_smootherWrappers_basm_NR_solve(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, ((
struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_t_3), __pyx_t_4, __pyx_t_5, __pyx_t_6);
6663 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6664 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6665 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
6666 __pyx_t_4.memview = NULL;
6667 __pyx_t_4.data = NULL;
6668 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
6669 __pyx_t_5.memview = NULL;
6670 __pyx_t_5.data = NULL;
6671 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6672 __pyx_t_6.memview = NULL;
6673 __pyx_t_6.data = NULL;
6684 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6687 __Pyx_XDECREF(__pyx_t_1);
6688 __Pyx_XDECREF(__pyx_t_3);
6689 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
6690 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
6691 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6692 __Pyx_AddTraceback(
"csmoothers.basm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
6695 __Pyx_XGIVEREF(__pyx_r);
6696 __Pyx_RefNannyFinishContext();
6708 static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm,
double __pyx_v_w,
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_basmFactor, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
6709 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
6710 __Pyx_RefNannyDeclarations
6711 PyObject *__pyx_t_1 = NULL;
6713 Py_ssize_t __pyx_t_3;
6714 Py_ssize_t __pyx_t_4;
6715 Py_ssize_t __pyx_t_5;
6716 __Pyx_RefNannySetupContext(
"smootherWrappers_basm_NR_solve", 0);
6725 __pyx_v_AS.Stype = SLU_NR;
6734 __pyx_v_AS.Dtype = SLU_D;
6743 __pyx_v_AS.Mtype = SLU_GE;
6752 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error)
6753 __Pyx_GOTREF(__pyx_t_1);
6754 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 379, __pyx_L1_error)
6755 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6756 __pyx_v_AS.nrow = __pyx_t_2;
6765 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
6766 __Pyx_GOTREF(__pyx_t_1);
6767 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 380, __pyx_L1_error)
6768 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6769 __pyx_v_AS.ncol = __pyx_t_2;
6778 __pyx_v_AS.Store = (&__pyx_v_sm->A);
6789 if (__pyx_t_3 < 0) {
6790 __pyx_t_3 += __pyx_v_R.shape[0];
6791 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
6792 }
else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
6793 if (unlikely(__pyx_t_2 != -1)) {
6794 __Pyx_RaiseBufferIndexError(__pyx_t_2);
6795 __PYX_ERR(0, 389, __pyx_L1_error)
6807 if (__pyx_t_4 < 0) {
6808 __pyx_t_4 += __pyx_v_node_order.shape[0];
6809 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
6810 }
else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
6811 if (unlikely(__pyx_t_2 != -1)) {
6812 __Pyx_RaiseBufferIndexError(__pyx_t_2);
6813 __PYX_ERR(0, 391, __pyx_L1_error)
6825 if (__pyx_t_5 < 0) {
6826 __pyx_t_5 += __pyx_v_dX.shape[0];
6827 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
6828 }
else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
6829 if (unlikely(__pyx_t_2 != -1)) {
6830 __Pyx_RaiseBufferIndexError(__pyx_t_2);
6831 __PYX_ERR(0, 393, __pyx_L1_error)
6841 basm_NR_solve(__pyx_v_basmFactor->bs, __pyx_v_basmFactor->N, (&__pyx_v_AS), __pyx_v_w, __pyx_v_basmFactor->subdomain_L, __pyx_v_basmFactor->subdomain_dim, __pyx_v_basmFactor->l2g_L, (&(*((
double *) ( (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), __pyx_v_basmFactor->subdomain_R, (&(*((
int *) ( (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_basmFactor->subdomain_dX, (&(*((
double *) ( (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))), __pyx_v_basmFactor->subdomain_pivots, __pyx_v_basmFactor->subdomain_col_pivots);
6854 __Pyx_XDECREF(__pyx_t_1);
6855 __Pyx_WriteUnraisable(
"csmoothers.smootherWrappers_basm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6857 __Pyx_RefNannyFinishContext();
6869 static CYTHON_UNUSED
int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
6870 static CYTHON_UNUSED
int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
6872 __Pyx_RefNannyDeclarations
6873 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
6874 __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
6877 __Pyx_RefNannyFinishContext();
6881 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
6884 int __pyx_v_endian_detector;
6885 int __pyx_v_little_endian;
6888 PyArray_Descr *__pyx_v_descr = 0;
6891 __Pyx_RefNannyDeclarations
6894 PyObject *__pyx_t_3 = NULL;
6898 PyArray_Descr *__pyx_t_7;
6899 PyObject *__pyx_t_8 = NULL;
6901 if (__pyx_v_info == NULL) {
6902 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
6905 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
6906 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
6907 __Pyx_GIVEREF(__pyx_v_info->obj);
6916 __pyx_v_endian_detector = 1;
6925 __pyx_v_little_endian = ((((
char *)(&__pyx_v_endian_detector))[0]) != 0);
6934 __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
6943 __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
6946 __pyx_t_1 = __pyx_t_2;
6947 goto __pyx_L4_bool_binop_done;
6957 __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_C_CONTIGUOUS) != 0)) != 0);
6958 __pyx_t_1 = __pyx_t_2;
6959 __pyx_L4_bool_binop_done:;
6968 if (unlikely(__pyx_t_1)) {
6977 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 272, __pyx_L1_error)
6978 __Pyx_GOTREF(__pyx_t_3);
6979 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6980 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6981 __PYX_ERR(2, 272, __pyx_L1_error)
6999 __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
7002 __pyx_t_1 = __pyx_t_2;
7003 goto __pyx_L7_bool_binop_done;
7013 __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_F_CONTIGUOUS) != 0)) != 0);
7014 __pyx_t_1 = __pyx_t_2;
7015 __pyx_L7_bool_binop_done:;
7024 if (unlikely(__pyx_t_1)) {
7033 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 276, __pyx_L1_error)
7034 __Pyx_GOTREF(__pyx_t_3);
7035 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7036 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7037 __PYX_ERR(2, 276, __pyx_L1_error)
7055 __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
7064 __pyx_v_info->ndim = __pyx_v_ndim;
7073 __pyx_t_1 = (((
sizeof(npy_intp)) != (
sizeof(Py_ssize_t))) != 0);
7083 __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((
sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim))));
7092 __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
7101 __pyx_t_4 = __pyx_v_ndim;
7102 __pyx_t_5 = __pyx_t_4;
7103 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
7104 __pyx_v_i = __pyx_t_6;
7113 (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
7122 (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
7143 __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
7152 __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
7163 __pyx_v_info->suboffsets = NULL;
7172 __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
7181 __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
7199 __pyx_t_7 = PyArray_DESCR(__pyx_v_self);
7200 __pyx_t_3 = ((PyObject *)__pyx_t_7);
7201 __Pyx_INCREF(__pyx_t_3);
7202 __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
7212 __Pyx_INCREF(((PyObject *)__pyx_v_self));
7213 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
7214 __Pyx_GOTREF(__pyx_v_info->obj);
7215 __Pyx_DECREF(__pyx_v_info->obj);
7216 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
7225 __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0);
7235 __pyx_t_4 = __pyx_v_descr->type_num;
7236 __pyx_v_t = __pyx_t_4;
7245 __pyx_t_2 = ((__pyx_v_descr->byteorder ==
'>') != 0);
7247 goto __pyx_L15_next_or;
7250 __pyx_t_2 = (__pyx_v_little_endian != 0);
7253 __pyx_t_1 = __pyx_t_2;
7254 goto __pyx_L14_bool_binop_done;
7265 __pyx_t_2 = ((__pyx_v_descr->byteorder ==
'<') != 0);
7268 __pyx_t_1 = __pyx_t_2;
7269 goto __pyx_L14_bool_binop_done;
7271 __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
7272 __pyx_t_1 = __pyx_t_2;
7273 __pyx_L14_bool_binop_done:;
7282 if (unlikely(__pyx_t_1)) {
7291 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 306, __pyx_L1_error)
7292 __Pyx_GOTREF(__pyx_t_3);
7293 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7294 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7295 __PYX_ERR(2, 306, __pyx_L1_error)
7313 switch (__pyx_v_t) {
7315 __pyx_v_f = ((
char *)
"b");
7326 __pyx_v_f = ((
char *)
"B");
7337 __pyx_v_f = ((
char *)
"h");
7348 __pyx_v_f = ((
char *)
"H");
7359 __pyx_v_f = ((
char *)
"i");
7370 __pyx_v_f = ((
char *)
"I");
7381 __pyx_v_f = ((
char *)
"l");
7392 __pyx_v_f = ((
char *)
"L");
7403 __pyx_v_f = ((
char *)
"q");
7414 __pyx_v_f = ((
char *)
"Q");
7425 __pyx_v_f = ((
char *)
"f");
7436 __pyx_v_f = ((
char *)
"d");
7438 case NPY_LONGDOUBLE:
7447 __pyx_v_f = ((
char *)
"g");
7458 __pyx_v_f = ((
char *)
"Zf");
7469 __pyx_v_f = ((
char *)
"Zd");
7471 case NPY_CLONGDOUBLE:
7480 __pyx_v_f = ((
char *)
"Zg");
7491 __pyx_v_f = ((
char *)
"O");
7502 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 325, __pyx_L1_error)
7503 __Pyx_GOTREF(__pyx_t_3);
7504 __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3);
if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 325, __pyx_L1_error)
7505 __Pyx_GOTREF(__pyx_t_8);
7506 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7507 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 325, __pyx_L1_error)
7508 __Pyx_GOTREF(__pyx_t_3);
7509 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7510 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7511 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7512 __PYX_ERR(2, 325, __pyx_L1_error)
7523 __pyx_v_info->format = __pyx_v_f;
7552 __pyx_v_info->format = ((
char *)PyObject_Malloc(0xFF));
7561 (__pyx_v_info->format[0]) =
'^';
7579 __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset));
if (unlikely(__pyx_t_9 == ((
char *)NULL))) __PYX_ERR(2, 332, __pyx_L1_error)
7580 __pyx_v_f = __pyx_t_9;
7589 (__pyx_v_f[0]) =
'\x00';
7604 __Pyx_XDECREF(__pyx_t_3);
7605 __Pyx_XDECREF(__pyx_t_8);
7606 __Pyx_AddTraceback(
"numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7608 if (__pyx_v_info->obj != NULL) {
7609 __Pyx_GOTREF(__pyx_v_info->obj);
7610 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
7614 if (__pyx_v_info->obj == Py_None) {
7615 __Pyx_GOTREF(__pyx_v_info->obj);
7616 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
7619 __Pyx_XDECREF((PyObject *)__pyx_v_descr);
7620 __Pyx_RefNannyFinishContext();
7633 static CYTHON_UNUSED
void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info);
7634 static CYTHON_UNUSED
void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
7635 __Pyx_RefNannyDeclarations
7636 __Pyx_RefNannySetupContext(
"__releasebuffer__ (wrapper)", 0);
7637 __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
7640 __Pyx_RefNannyFinishContext();
7643 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
7644 __Pyx_RefNannyDeclarations
7646 __Pyx_RefNannySetupContext(
"__releasebuffer__", 0);
7655 __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
7665 PyObject_Free(__pyx_v_info->format);
7683 __pyx_t_1 = (((
sizeof(npy_intp)) != (
sizeof(Py_ssize_t))) != 0);
7693 PyObject_Free(__pyx_v_info->strides);
7713 __Pyx_RefNannyFinishContext();
7724 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
7725 PyObject *__pyx_r = NULL;
7726 __Pyx_RefNannyDeclarations
7727 PyObject *__pyx_t_1 = NULL;
7728 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew1", 0);
7737 __Pyx_XDECREF(__pyx_r);
7738 __pyx_t_1 = PyArray_MultiIterNew(1, ((
void *)__pyx_v_a));
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 822, __pyx_L1_error)
7739 __Pyx_GOTREF(__pyx_t_1);
7740 __pyx_r = __pyx_t_1;
7754 __Pyx_XDECREF(__pyx_t_1);
7755 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
7758 __Pyx_XGIVEREF(__pyx_r);
7759 __Pyx_RefNannyFinishContext();
7771 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
7772 PyObject *__pyx_r = NULL;
7773 __Pyx_RefNannyDeclarations
7774 PyObject *__pyx_t_1 = NULL;
7775 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew2", 0);
7784 __Pyx_XDECREF(__pyx_r);
7785 __pyx_t_1 = PyArray_MultiIterNew(2, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b));
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 825, __pyx_L1_error)
7786 __Pyx_GOTREF(__pyx_t_1);
7787 __pyx_r = __pyx_t_1;
7801 __Pyx_XDECREF(__pyx_t_1);
7802 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
7805 __Pyx_XGIVEREF(__pyx_r);
7806 __Pyx_RefNannyFinishContext();
7818 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
7819 PyObject *__pyx_r = NULL;
7820 __Pyx_RefNannyDeclarations
7821 PyObject *__pyx_t_1 = NULL;
7822 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew3", 0);
7831 __Pyx_XDECREF(__pyx_r);
7832 __pyx_t_1 = PyArray_MultiIterNew(3, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c));
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 828, __pyx_L1_error)
7833 __Pyx_GOTREF(__pyx_t_1);
7834 __pyx_r = __pyx_t_1;
7848 __Pyx_XDECREF(__pyx_t_1);
7849 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
7852 __Pyx_XGIVEREF(__pyx_r);
7853 __Pyx_RefNannyFinishContext();
7865 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
7866 PyObject *__pyx_r = NULL;
7867 __Pyx_RefNannyDeclarations
7868 PyObject *__pyx_t_1 = NULL;
7869 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew4", 0);
7878 __Pyx_XDECREF(__pyx_r);
7879 __pyx_t_1 = PyArray_MultiIterNew(4, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c), ((
void *)__pyx_v_d));
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 831, __pyx_L1_error)
7880 __Pyx_GOTREF(__pyx_t_1);
7881 __pyx_r = __pyx_t_1;
7895 __Pyx_XDECREF(__pyx_t_1);
7896 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
7899 __Pyx_XGIVEREF(__pyx_r);
7900 __Pyx_RefNannyFinishContext();
7912 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
7913 PyObject *__pyx_r = NULL;
7914 __Pyx_RefNannyDeclarations
7915 PyObject *__pyx_t_1 = NULL;
7916 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew5", 0);
7925 __Pyx_XDECREF(__pyx_r);
7926 __pyx_t_1 = PyArray_MultiIterNew(5, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c), ((
void *)__pyx_v_d), ((
void *)__pyx_v_e));
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 834, __pyx_L1_error)
7927 __Pyx_GOTREF(__pyx_t_1);
7928 __pyx_r = __pyx_t_1;
7942 __Pyx_XDECREF(__pyx_t_1);
7943 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
7946 __Pyx_XGIVEREF(__pyx_r);
7947 __Pyx_RefNannyFinishContext();
7959 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
7960 PyObject *__pyx_r = NULL;
7961 __Pyx_RefNannyDeclarations
7963 __Pyx_RefNannySetupContext(
"PyDataType_SHAPE", 0);
7972 __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
7982 __Pyx_XDECREF(__pyx_r);
7983 __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
7984 __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
8004 __Pyx_XDECREF(__pyx_r);
8005 __Pyx_INCREF(__pyx_empty_tuple);
8006 __pyx_r = __pyx_empty_tuple;
8020 __Pyx_XGIVEREF(__pyx_r);
8021 __Pyx_RefNannyFinishContext();
8033 static CYTHON_INLINE
char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr,
char *__pyx_v_f,
char *__pyx_v_end,
int *__pyx_v_offset) {
8034 PyArray_Descr *__pyx_v_child = 0;
8035 int __pyx_v_endian_detector;
8036 int __pyx_v_little_endian;
8037 PyObject *__pyx_v_fields = 0;
8038 PyObject *__pyx_v_childname = NULL;
8039 PyObject *__pyx_v_new_offset = NULL;
8040 PyObject *__pyx_v_t = NULL;
8042 __Pyx_RefNannyDeclarations
8043 PyObject *__pyx_t_1 = NULL;
8044 Py_ssize_t __pyx_t_2;
8045 PyObject *__pyx_t_3 = NULL;
8046 PyObject *__pyx_t_4 = NULL;
8052 __Pyx_RefNannySetupContext(
"_util_dtypestring", 0);
8061 __pyx_v_endian_detector = 1;
8070 __pyx_v_little_endian = ((((
char *)(&__pyx_v_endian_detector))[0]) != 0);
8079 if (unlikely(__pyx_v_descr->names == Py_None)) {
8080 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
8081 __PYX_ERR(2, 851, __pyx_L1_error)
8083 __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
8085 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1))
break;
8086 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 8087 __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++;
if (unlikely(0 < 0)) __PYX_ERR(2, 851, __pyx_L1_error)
8089 __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++;
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 851, __pyx_L1_error)
8090 __Pyx_GOTREF(__pyx_t_3);
8092 __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
8102 if (unlikely(__pyx_v_descr->fields == Py_None)) {
8103 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
8104 __PYX_ERR(2, 852, __pyx_L1_error)
8106 __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 852, __pyx_L1_error)
8107 __Pyx_GOTREF(__pyx_t_3);
8108 if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(2, 852, __pyx_L1_error)
8109 __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
8119 if (likely(__pyx_v_fields != Py_None)) {
8120 PyObject* sequence = __pyx_v_fields;
8121 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
8122 if (unlikely(size != 2)) {
8123 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
8124 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
8125 __PYX_ERR(2, 853, __pyx_L1_error)
8127 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 8128 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
8129 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
8130 __Pyx_INCREF(__pyx_t_3);
8131 __Pyx_INCREF(__pyx_t_4);
8133 __pyx_t_3 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 853, __pyx_L1_error)
8134 __Pyx_GOTREF(__pyx_t_3);
8135 __pyx_t_4 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 853, __pyx_L1_error)
8136 __Pyx_GOTREF(__pyx_t_4);
8139 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 853, __pyx_L1_error)
8141 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(2, 853, __pyx_L1_error)
8142 __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
8144 __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
8154 __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0]));
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 855, __pyx_L1_error)
8155 __Pyx_GOTREF(__pyx_t_4);
8156 __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 855, __pyx_L1_error)
8157 __Pyx_GOTREF(__pyx_t_3);
8158 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8159 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(2, 855, __pyx_L1_error)
8160 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8161 __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((
int)__pyx_t_5)) < 15) != 0);
8162 if (unlikely(__pyx_t_6)) {
8171 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__8, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 856, __pyx_L1_error)
8172 __Pyx_GOTREF(__pyx_t_3);
8173 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8174 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8175 __PYX_ERR(2, 856, __pyx_L1_error)
8193 __pyx_t_7 = ((__pyx_v_child->byteorder ==
'>') != 0);
8195 goto __pyx_L8_next_or;
8198 __pyx_t_7 = (__pyx_v_little_endian != 0);
8201 __pyx_t_6 = __pyx_t_7;
8202 goto __pyx_L7_bool_binop_done;
8213 __pyx_t_7 = ((__pyx_v_child->byteorder ==
'<') != 0);
8216 __pyx_t_6 = __pyx_t_7;
8217 goto __pyx_L7_bool_binop_done;
8219 __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
8220 __pyx_t_6 = __pyx_t_7;
8221 __pyx_L7_bool_binop_done:;
8230 if (unlikely(__pyx_t_6)) {
8239 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 860, __pyx_L1_error)
8240 __Pyx_GOTREF(__pyx_t_3);
8241 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8242 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8243 __PYX_ERR(2, 860, __pyx_L1_error)
8262 __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0]));
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 870, __pyx_L1_error)
8263 __Pyx_GOTREF(__pyx_t_3);
8264 __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 870, __pyx_L1_error)
8265 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8266 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 870, __pyx_L1_error)
8267 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8268 if (!__pyx_t_6)
break;
8277 (__pyx_v_f[0]) = 0x78;
8286 __pyx_v_f = (__pyx_v_f + 1);
8296 (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
8307 (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
8316 __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
8326 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 878, __pyx_L1_error)
8327 __Pyx_GOTREF(__pyx_t_4);
8328 __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
8338 __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
8339 if (unlikely(__pyx_t_6)) {
8348 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__9, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 880, __pyx_L1_error)
8349 __Pyx_GOTREF(__pyx_t_4);
8350 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
8351 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8352 __PYX_ERR(2, 880, __pyx_L1_error)
8370 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 883, __pyx_L1_error)
8371 __Pyx_GOTREF(__pyx_t_4);
8372 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 883, __pyx_L1_error)
8373 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8374 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 883, __pyx_L1_error)
8375 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8377 (__pyx_v_f[0]) = 98;
8388 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 884, __pyx_L1_error)
8389 __Pyx_GOTREF(__pyx_t_3);
8390 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 884, __pyx_L1_error)
8391 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8392 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 884, __pyx_L1_error)
8393 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8395 (__pyx_v_f[0]) = 66;
8406 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 885, __pyx_L1_error)
8407 __Pyx_GOTREF(__pyx_t_4);
8408 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 885, __pyx_L1_error)
8409 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8410 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 885, __pyx_L1_error)
8411 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8413 (__pyx_v_f[0]) = 0x68;
8424 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 886, __pyx_L1_error)
8425 __Pyx_GOTREF(__pyx_t_3);
8426 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 886, __pyx_L1_error)
8427 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8428 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 886, __pyx_L1_error)
8429 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8431 (__pyx_v_f[0]) = 72;
8442 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 887, __pyx_L1_error)
8443 __Pyx_GOTREF(__pyx_t_4);
8444 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 887, __pyx_L1_error)
8445 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8446 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 887, __pyx_L1_error)
8447 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8449 (__pyx_v_f[0]) = 0x69;
8460 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 888, __pyx_L1_error)
8461 __Pyx_GOTREF(__pyx_t_3);
8462 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 888, __pyx_L1_error)
8463 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8464 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 888, __pyx_L1_error)
8465 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8467 (__pyx_v_f[0]) = 73;
8478 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 889, __pyx_L1_error)
8479 __Pyx_GOTREF(__pyx_t_4);
8480 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 889, __pyx_L1_error)
8481 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8482 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 889, __pyx_L1_error)
8483 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8485 (__pyx_v_f[0]) = 0x6C;
8496 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 890, __pyx_L1_error)
8497 __Pyx_GOTREF(__pyx_t_3);
8498 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 890, __pyx_L1_error)
8499 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8500 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 890, __pyx_L1_error)
8501 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8503 (__pyx_v_f[0]) = 76;
8514 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 891, __pyx_L1_error)
8515 __Pyx_GOTREF(__pyx_t_4);
8516 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 891, __pyx_L1_error)
8517 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8518 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 891, __pyx_L1_error)
8519 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8521 (__pyx_v_f[0]) = 0x71;
8532 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 892, __pyx_L1_error)
8533 __Pyx_GOTREF(__pyx_t_3);
8534 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 892, __pyx_L1_error)
8535 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8536 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 892, __pyx_L1_error)
8537 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8539 (__pyx_v_f[0]) = 81;
8550 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 893, __pyx_L1_error)
8551 __Pyx_GOTREF(__pyx_t_4);
8552 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 893, __pyx_L1_error)
8553 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8554 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 893, __pyx_L1_error)
8555 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8557 (__pyx_v_f[0]) = 0x66;
8568 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 894, __pyx_L1_error)
8569 __Pyx_GOTREF(__pyx_t_3);
8570 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 894, __pyx_L1_error)
8571 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8572 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 894, __pyx_L1_error)
8573 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8575 (__pyx_v_f[0]) = 0x64;
8586 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 895, __pyx_L1_error)
8587 __Pyx_GOTREF(__pyx_t_4);
8588 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 895, __pyx_L1_error)
8589 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8590 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 895, __pyx_L1_error)
8591 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8593 (__pyx_v_f[0]) = 0x67;
8604 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 896, __pyx_L1_error)
8605 __Pyx_GOTREF(__pyx_t_3);
8606 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 896, __pyx_L1_error)
8607 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8608 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 896, __pyx_L1_error)
8609 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8611 (__pyx_v_f[0]) = 90;
8612 (__pyx_v_f[1]) = 0x66;
8613 __pyx_v_f = (__pyx_v_f + 1);
8624 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 897, __pyx_L1_error)
8625 __Pyx_GOTREF(__pyx_t_4);
8626 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 897, __pyx_L1_error)
8627 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8628 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 897, __pyx_L1_error)
8629 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8631 (__pyx_v_f[0]) = 90;
8632 (__pyx_v_f[1]) = 0x64;
8633 __pyx_v_f = (__pyx_v_f + 1);
8644 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 898, __pyx_L1_error)
8645 __Pyx_GOTREF(__pyx_t_3);
8646 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 898, __pyx_L1_error)
8647 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8648 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 898, __pyx_L1_error)
8649 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8651 (__pyx_v_f[0]) = 90;
8652 (__pyx_v_f[1]) = 0x67;
8653 __pyx_v_f = (__pyx_v_f + 1);
8664 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 899, __pyx_L1_error)
8665 __Pyx_GOTREF(__pyx_t_4);
8666 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 899, __pyx_L1_error)
8667 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8668 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 899, __pyx_L1_error)
8669 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8670 if (likely(__pyx_t_6)) {
8671 (__pyx_v_f[0]) = 79;
8683 __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 901, __pyx_L1_error)
8684 __Pyx_GOTREF(__pyx_t_3);
8685 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 901, __pyx_L1_error)
8686 __Pyx_GOTREF(__pyx_t_4);
8687 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8688 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
8689 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8690 __PYX_ERR(2, 901, __pyx_L1_error)
8701 __pyx_v_f = (__pyx_v_f + 1);
8721 __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset);
if (unlikely(__pyx_t_9 == ((
char *)NULL))) __PYX_ERR(2, 906, __pyx_L1_error)
8722 __pyx_v_f = __pyx_t_9;
8734 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8743 __pyx_r = __pyx_v_f;
8756 __Pyx_XDECREF(__pyx_t_1);
8757 __Pyx_XDECREF(__pyx_t_3);
8758 __Pyx_XDECREF(__pyx_t_4);
8759 __Pyx_AddTraceback(
"numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
8762 __Pyx_XDECREF((PyObject *)__pyx_v_child);
8763 __Pyx_XDECREF(__pyx_v_fields);
8764 __Pyx_XDECREF(__pyx_v_childname);
8765 __Pyx_XDECREF(__pyx_v_new_offset);
8766 __Pyx_XDECREF(__pyx_v_t);
8767 __Pyx_RefNannyFinishContext();
8779 static CYTHON_INLINE
void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
8780 __Pyx_RefNannyDeclarations
8781 __Pyx_RefNannySetupContext(
"set_array_base", 0);
8790 Py_INCREF(__pyx_v_base);
8799 (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
8810 __Pyx_RefNannyFinishContext();
8821 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
8822 PyObject *__pyx_v_base;
8823 PyObject *__pyx_r = NULL;
8824 __Pyx_RefNannyDeclarations
8826 __Pyx_RefNannySetupContext(
"get_array_base", 0);
8835 __pyx_v_base = PyArray_BASE(__pyx_v_arr);
8844 __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
8854 __Pyx_XDECREF(__pyx_r);
8855 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8874 __Pyx_XDECREF(__pyx_r);
8875 __Pyx_INCREF(((PyObject *)__pyx_v_base));
8876 __pyx_r = ((PyObject *)__pyx_v_base);
8889 __Pyx_XGIVEREF(__pyx_r);
8890 __Pyx_RefNannyFinishContext();
8902 static CYTHON_INLINE
int __pyx_f_5numpy_import_array(
void) {
8904 __Pyx_RefNannyDeclarations
8905 PyObject *__pyx_t_1 = NULL;
8906 PyObject *__pyx_t_2 = NULL;
8907 PyObject *__pyx_t_3 = NULL;
8909 PyObject *__pyx_t_5 = NULL;
8910 PyObject *__pyx_t_6 = NULL;
8911 PyObject *__pyx_t_7 = NULL;
8912 PyObject *__pyx_t_8 = NULL;
8913 __Pyx_RefNannySetupContext(
"import_array", 0);
8923 __Pyx_PyThreadState_declare
8924 __Pyx_PyThreadState_assign
8925 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
8926 __Pyx_XGOTREF(__pyx_t_1);
8927 __Pyx_XGOTREF(__pyx_t_2);
8928 __Pyx_XGOTREF(__pyx_t_3);
8938 __pyx_t_4 = _import_array();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 1036, __pyx_L3_error)
8948 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8949 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8950 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8951 goto __pyx_L8_try_end;
8961 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8963 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
8964 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1037, __pyx_L5_except_error)
8965 __Pyx_GOTREF(__pyx_t_5);
8966 __Pyx_GOTREF(__pyx_t_6);
8967 __Pyx_GOTREF(__pyx_t_7);
8976 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1038, __pyx_L5_except_error)
8977 __Pyx_GOTREF(__pyx_t_8);
8978 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8979 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8980 __PYX_ERR(2, 1038, __pyx_L5_except_error)
8982 goto __pyx_L5_except_error;
8983 __pyx_L5_except_error:;
8992 __Pyx_XGIVEREF(__pyx_t_1);
8993 __Pyx_XGIVEREF(__pyx_t_2);
8994 __Pyx_XGIVEREF(__pyx_t_3);
8995 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8996 goto __pyx_L1_error;
9012 __Pyx_XDECREF(__pyx_t_5);
9013 __Pyx_XDECREF(__pyx_t_6);
9014 __Pyx_XDECREF(__pyx_t_7);
9015 __Pyx_XDECREF(__pyx_t_8);
9016 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
9019 __Pyx_RefNannyFinishContext();
9031 static CYTHON_INLINE
int __pyx_f_5numpy_import_umath(
void) {
9033 __Pyx_RefNannyDeclarations
9034 PyObject *__pyx_t_1 = NULL;
9035 PyObject *__pyx_t_2 = NULL;
9036 PyObject *__pyx_t_3 = NULL;
9038 PyObject *__pyx_t_5 = NULL;
9039 PyObject *__pyx_t_6 = NULL;
9040 PyObject *__pyx_t_7 = NULL;
9041 PyObject *__pyx_t_8 = NULL;
9042 __Pyx_RefNannySetupContext(
"import_umath", 0);
9052 __Pyx_PyThreadState_declare
9053 __Pyx_PyThreadState_assign
9054 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
9055 __Pyx_XGOTREF(__pyx_t_1);
9056 __Pyx_XGOTREF(__pyx_t_2);
9057 __Pyx_XGOTREF(__pyx_t_3);
9067 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 1042, __pyx_L3_error)
9077 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
9078 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
9079 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9080 goto __pyx_L8_try_end;
9090 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
9092 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
9093 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1043, __pyx_L5_except_error)
9094 __Pyx_GOTREF(__pyx_t_5);
9095 __Pyx_GOTREF(__pyx_t_6);
9096 __Pyx_GOTREF(__pyx_t_7);
9105 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__11, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1044, __pyx_L5_except_error)
9106 __Pyx_GOTREF(__pyx_t_8);
9107 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
9108 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9109 __PYX_ERR(2, 1044, __pyx_L5_except_error)
9111 goto __pyx_L5_except_error;
9112 __pyx_L5_except_error:;
9121 __Pyx_XGIVEREF(__pyx_t_1);
9122 __Pyx_XGIVEREF(__pyx_t_2);
9123 __Pyx_XGIVEREF(__pyx_t_3);
9124 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
9125 goto __pyx_L1_error;
9141 __Pyx_XDECREF(__pyx_t_5);
9142 __Pyx_XDECREF(__pyx_t_6);
9143 __Pyx_XDECREF(__pyx_t_7);
9144 __Pyx_XDECREF(__pyx_t_8);
9145 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
9148 __Pyx_RefNannyFinishContext();
9160 static CYTHON_INLINE
int __pyx_f_5numpy_import_ufunc(
void) {
9162 __Pyx_RefNannyDeclarations
9163 PyObject *__pyx_t_1 = NULL;
9164 PyObject *__pyx_t_2 = NULL;
9165 PyObject *__pyx_t_3 = NULL;
9167 PyObject *__pyx_t_5 = NULL;
9168 PyObject *__pyx_t_6 = NULL;
9169 PyObject *__pyx_t_7 = NULL;
9170 PyObject *__pyx_t_8 = NULL;
9171 __Pyx_RefNannySetupContext(
"import_ufunc", 0);
9181 __Pyx_PyThreadState_declare
9182 __Pyx_PyThreadState_assign
9183 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
9184 __Pyx_XGOTREF(__pyx_t_1);
9185 __Pyx_XGOTREF(__pyx_t_2);
9186 __Pyx_XGOTREF(__pyx_t_3);
9196 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 1048, __pyx_L3_error)
9206 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
9207 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
9208 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9209 goto __pyx_L8_try_end;
9218 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
9220 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
9221 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1049, __pyx_L5_except_error)
9222 __Pyx_GOTREF(__pyx_t_5);
9223 __Pyx_GOTREF(__pyx_t_6);
9224 __Pyx_GOTREF(__pyx_t_7);
9231 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__11, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1050, __pyx_L5_except_error)
9232 __Pyx_GOTREF(__pyx_t_8);
9233 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
9234 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9235 __PYX_ERR(2, 1050, __pyx_L5_except_error)
9237 goto __pyx_L5_except_error;
9238 __pyx_L5_except_error:;
9247 __Pyx_XGIVEREF(__pyx_t_1);
9248 __Pyx_XGIVEREF(__pyx_t_2);
9249 __Pyx_XGIVEREF(__pyx_t_3);
9250 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
9251 goto __pyx_L1_error;
9267 __Pyx_XDECREF(__pyx_t_5);
9268 __Pyx_XDECREF(__pyx_t_6);
9269 __Pyx_XDECREF(__pyx_t_7);
9270 __Pyx_XDECREF(__pyx_t_8);
9271 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
9274 __Pyx_RefNannyFinishContext();
9287 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
9288 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9289 PyObject *__pyx_v_shape = 0;
9290 Py_ssize_t __pyx_v_itemsize;
9291 PyObject *__pyx_v_format = 0;
9292 PyObject *__pyx_v_mode = 0;
9293 int __pyx_v_allocate_buffer;
9295 __Pyx_RefNannyDeclarations
9296 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
9298 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
9299 PyObject* values[5] = {0,0,0,0,0};
9300 values[3] = ((PyObject *)__pyx_n_s_c);
9301 if (unlikely(__pyx_kwds)) {
9303 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9305 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
9307 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
9309 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9311 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9313 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9316 default:
goto __pyx_L5_argtuple_error;
9318 kw_args = PyDict_Size(__pyx_kwds);
9321 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
9322 else goto __pyx_L5_argtuple_error;
9325 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
9327 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 122, __pyx_L3_error)
9331 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
9333 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 122, __pyx_L3_error)
9338 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
9339 if (value) { values[3] = value; kw_args--; }
9344 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
9345 if (value) { values[4] = value; kw_args--; }
9348 if (unlikely(kw_args > 0)) {
9349 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(1, 122, __pyx_L3_error)
9352 switch (PyTuple_GET_SIZE(__pyx_args)) {
9353 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
9355 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
9357 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9358 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9359 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9361 default:
goto __pyx_L5_argtuple_error;
9364 __pyx_v_shape = ((PyObject*)values[0]);
9365 __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]);
if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
9366 __pyx_v_format = values[2];
9367 __pyx_v_mode = values[3];
9369 __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]);
if (unlikely((__pyx_v_allocate_buffer == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L3_error)
9379 __pyx_v_allocate_buffer = ((int)1);
9382 goto __pyx_L4_argument_unpacking_done;
9383 __pyx_L5_argtuple_error:;
9384 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 122, __pyx_L3_error)
9386 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9387 __Pyx_RefNannyFinishContext();
9389 __pyx_L4_argument_unpacking_done:;
9390 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1,
"shape", 1))) __PYX_ERR(1, 122, __pyx_L1_error)
9391 if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
9392 PyErr_Format(PyExc_TypeError,
"Argument '%.200s' must not be None",
"format"); __PYX_ERR(1, 122, __pyx_L1_error)
9394 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((
struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
9409 __Pyx_RefNannyFinishContext();
9413 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode,
int __pyx_v_allocate_buffer) {
9415 Py_ssize_t __pyx_v_i;
9416 Py_ssize_t __pyx_v_dim;
9417 PyObject **__pyx_v_p;
9420 __Pyx_RefNannyDeclarations
9421 Py_ssize_t __pyx_t_1;
9423 PyObject *__pyx_t_3 = NULL;
9425 PyObject *__pyx_t_5 = NULL;
9426 PyObject *__pyx_t_6 = NULL;
9429 Py_ssize_t __pyx_t_9;
9430 PyObject *__pyx_t_10 = NULL;
9431 Py_ssize_t __pyx_t_11;
9432 __Pyx_RefNannySetupContext(
"__cinit__", 0);
9433 __Pyx_INCREF(__pyx_v_format);
9442 if (unlikely(__pyx_v_shape == Py_None)) {
9443 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
9444 __PYX_ERR(1, 129, __pyx_L1_error)
9446 __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape);
if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 129, __pyx_L1_error)
9447 __pyx_v_self->ndim = ((int)__pyx_t_1);
9456 __pyx_v_self->itemsize = __pyx_v_itemsize;
9465 __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
9466 if (unlikely(__pyx_t_2)) {
9475 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 133, __pyx_L1_error)
9476 __Pyx_GOTREF(__pyx_t_3);
9477 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9478 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9479 __PYX_ERR(1, 133, __pyx_L1_error)
9497 __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
9498 if (unlikely(__pyx_t_2)) {
9507 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 136, __pyx_L1_error)
9508 __Pyx_GOTREF(__pyx_t_3);
9509 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9510 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9511 __PYX_ERR(1, 136, __pyx_L1_error)
9529 __pyx_t_2 = PyBytes_Check(__pyx_v_format);
9530 __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
9540 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 139, __pyx_L1_error)
9541 __Pyx_GOTREF(__pyx_t_5);
9543 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
9544 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
9545 if (likely(__pyx_t_6)) {
9546 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
9547 __Pyx_INCREF(__pyx_t_6);
9548 __Pyx_INCREF(
function);
9549 __Pyx_DECREF_SET(__pyx_t_5,
function);
9552 __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
9553 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9554 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 139, __pyx_L1_error)
9555 __Pyx_GOTREF(__pyx_t_3);
9556 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9557 __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
9576 if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 140, __pyx_L1_error)
9577 __pyx_t_3 = __pyx_v_format;
9578 __Pyx_INCREF(__pyx_t_3);
9579 __Pyx_GIVEREF(__pyx_t_3);
9580 __Pyx_GOTREF(__pyx_v_self->_format);
9581 __Pyx_DECREF(__pyx_v_self->_format);
9582 __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
9592 if (unlikely(__pyx_v_self->_format == Py_None)) {
9593 PyErr_SetString(PyExc_TypeError,
"expected bytes, NoneType found");
9594 __PYX_ERR(1, 141, __pyx_L1_error)
9596 __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format);
if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 141, __pyx_L1_error)
9597 __pyx_v_self->format = __pyx_t_7;
9606 __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((
sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
9615 __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
9624 __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
9625 if (unlikely(__pyx_t_4)) {
9634 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__14, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 148, __pyx_L1_error)
9635 __Pyx_GOTREF(__pyx_t_3);
9636 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9637 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9638 __PYX_ERR(1, 148, __pyx_L1_error)
9657 __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
9659 if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
9660 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 9661 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++;
if (unlikely(0 < 0)) __PYX_ERR(1, 151, __pyx_L1_error)
9663 __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 151, __pyx_L1_error)
9664 __Pyx_GOTREF(__pyx_t_5);
9666 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 151, __pyx_L1_error)
9667 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9668 __pyx_v_dim = __pyx_t_9;
9669 __pyx_v_idx = __pyx_t_8;
9670 __pyx_t_8 = (__pyx_t_8 + 1);
9679 __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
9680 if (unlikely(__pyx_t_4)) {
9689 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 153, __pyx_L1_error)
9690 __Pyx_GOTREF(__pyx_t_5);
9691 __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
9692 __Pyx_GOTREF(__pyx_t_6);
9693 __pyx_t_10 = PyTuple_New(2);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
9694 __Pyx_GOTREF(__pyx_t_10);
9695 __Pyx_GIVEREF(__pyx_t_5);
9696 PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
9697 __Pyx_GIVEREF(__pyx_t_6);
9698 PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
9701 __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
9702 __Pyx_GOTREF(__pyx_t_6);
9703 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9704 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
9705 __Pyx_GOTREF(__pyx_t_10);
9706 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9707 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
9708 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9709 __PYX_ERR(1, 153, __pyx_L1_error)
9727 (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
9737 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9746 __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 157, __pyx_L1_error)
9756 __pyx_v_order =
'F';
9765 __Pyx_INCREF(__pyx_n_u_fortran);
9766 __Pyx_GIVEREF(__pyx_n_u_fortran);
9767 __Pyx_GOTREF(__pyx_v_self->mode);
9768 __Pyx_DECREF(__pyx_v_self->mode);
9769 __pyx_v_self->mode = __pyx_n_u_fortran;
9788 __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 160, __pyx_L1_error)
9789 if (likely(__pyx_t_4)) {
9798 __pyx_v_order =
'C';
9807 __Pyx_INCREF(__pyx_n_u_c);
9808 __Pyx_GIVEREF(__pyx_n_u_c);
9809 __Pyx_GOTREF(__pyx_v_self->mode);
9810 __Pyx_DECREF(__pyx_v_self->mode);
9811 __pyx_v_self->mode = __pyx_n_u_c;
9831 __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 164, __pyx_L1_error)
9832 __Pyx_GOTREF(__pyx_t_3);
9833 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 164, __pyx_L1_error)
9834 __Pyx_GOTREF(__pyx_t_10);
9835 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9836 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
9837 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9838 __PYX_ERR(1, 164, __pyx_L1_error)
9849 __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
9858 __pyx_v_self->free_data = __pyx_v_allocate_buffer;
9867 __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 170, __pyx_L1_error)
9868 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 170, __pyx_L1_error)
9869 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9870 __pyx_v_self->dtype_is_object = __pyx_t_4;
9879 __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
9889 __pyx_v_self->data = ((
char *)malloc(__pyx_v_self->len));
9898 __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
9899 if (unlikely(__pyx_t_4)) {
9908 __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__15, NULL);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 176, __pyx_L1_error)
9909 __Pyx_GOTREF(__pyx_t_10);
9910 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
9911 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9912 __PYX_ERR(1, 176, __pyx_L1_error)
9930 __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
9940 __pyx_v_p = ((PyObject **)__pyx_v_self->data);
9949 if (unlikely(__pyx_v_itemsize == 0)) {
9950 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
9951 __PYX_ERR(1, 180, __pyx_L1_error)
9953 else if (
sizeof(Py_ssize_t) ==
sizeof(
long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
9954 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
9955 __PYX_ERR(1, 180, __pyx_L1_error)
9957 __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
9958 __pyx_t_9 = __pyx_t_1;
9959 for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
9960 __pyx_v_i = __pyx_t_11;
9969 (__pyx_v_p[__pyx_v_i]) = Py_None;
10011 __Pyx_XDECREF(__pyx_t_3);
10012 __Pyx_XDECREF(__pyx_t_5);
10013 __Pyx_XDECREF(__pyx_t_6);
10014 __Pyx_XDECREF(__pyx_t_10);
10015 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10018 __Pyx_XDECREF(__pyx_v_format);
10019 __Pyx_RefNannyFinishContext();
10032 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
10033 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
10035 __Pyx_RefNannyDeclarations
10036 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
10037 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((
struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
10040 __Pyx_RefNannyFinishContext();
10044 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(
struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
10045 int __pyx_v_bufmode;
10047 __Pyx_RefNannyDeclarations
10050 PyObject *__pyx_t_3 = NULL;
10052 Py_ssize_t __pyx_t_5;
10054 Py_ssize_t *__pyx_t_7;
10055 if (__pyx_v_info == NULL) {
10056 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
10059 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
10060 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
10061 __Pyx_GIVEREF(__pyx_v_info->obj);
10070 __pyx_v_bufmode = -1;
10079 __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 187, __pyx_L1_error)
10080 __pyx_t_2 = (__pyx_t_1 != 0);
10090 __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
10109 __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 189, __pyx_L1_error)
10110 __pyx_t_1 = (__pyx_t_2 != 0);
10120 __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
10139 __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
10140 if (unlikely(__pyx_t_1)) {
10149 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 192, __pyx_L1_error)
10150 __Pyx_GOTREF(__pyx_t_3);
10151 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
10152 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10153 __PYX_ERR(1, 192, __pyx_L1_error)
10171 __pyx_t_4 = __pyx_v_self->data;
10172 __pyx_v_info->buf = __pyx_t_4;
10181 __pyx_t_5 = __pyx_v_self->len;
10182 __pyx_v_info->len = __pyx_t_5;
10191 __pyx_t_6 = __pyx_v_self->ndim;
10192 __pyx_v_info->ndim = __pyx_t_6;
10201 __pyx_t_7 = __pyx_v_self->_shape;
10202 __pyx_v_info->shape = __pyx_t_7;
10211 __pyx_t_7 = __pyx_v_self->_strides;
10212 __pyx_v_info->strides = __pyx_t_7;
10221 __pyx_v_info->suboffsets = NULL;
10230 __pyx_t_5 = __pyx_v_self->itemsize;
10231 __pyx_v_info->itemsize = __pyx_t_5;
10240 __pyx_v_info->readonly = 0;
10249 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
10259 __pyx_t_4 = __pyx_v_self->format;
10260 __pyx_v_info->format = __pyx_t_4;
10280 __pyx_v_info->format = NULL;
10291 __Pyx_INCREF(((PyObject *)__pyx_v_self));
10292 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
10293 __Pyx_GOTREF(__pyx_v_info->obj);
10294 __Pyx_DECREF(__pyx_v_info->obj);
10295 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
10309 __Pyx_XDECREF(__pyx_t_3);
10310 __Pyx_AddTraceback(
"View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10312 if (__pyx_v_info->obj != NULL) {
10313 __Pyx_GOTREF(__pyx_v_info->obj);
10314 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10318 if (__pyx_v_info->obj == Py_None) {
10319 __Pyx_GOTREF(__pyx_v_info->obj);
10320 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10323 __Pyx_RefNannyFinishContext();
10336 static void __pyx_array___dealloc__(PyObject *__pyx_v_self);
10337 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
10338 __Pyx_RefNannyDeclarations
10339 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
10340 __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((
struct __pyx_array_obj *)__pyx_v_self));
10343 __Pyx_RefNannyFinishContext();
10346 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self) {
10347 __Pyx_RefNannyDeclarations
10349 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
10358 __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
10368 __pyx_v_self->callback_free_data(__pyx_v_self->data);
10387 __pyx_t_1 = (__pyx_v_self->free_data != 0);
10397 __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
10407 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
10425 free(__pyx_v_self->data);
10444 PyObject_Free(__pyx_v_self->_shape);
10455 __Pyx_RefNannyFinishContext();
10467 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self);
10468 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
10469 PyObject *__pyx_r = 0;
10470 __Pyx_RefNannyDeclarations
10471 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
10472 __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((
struct __pyx_array_obj *)__pyx_v_self));
10475 __Pyx_RefNannyFinishContext();
10479 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self) {
10480 PyObject *__pyx_r = NULL;
10481 __Pyx_RefNannyDeclarations
10482 PyObject *__pyx_t_1 = NULL;
10483 __Pyx_RefNannySetupContext(
"__get__", 0);
10492 __Pyx_XDECREF(__pyx_r);
10493 __pyx_t_1 = ((
struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 223, __pyx_L1_error)
10494 __Pyx_GOTREF(__pyx_t_1);
10495 __pyx_r = __pyx_t_1;
10509 __Pyx_XDECREF(__pyx_t_1);
10510 __Pyx_AddTraceback(
"View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10513 __Pyx_XGIVEREF(__pyx_r);
10514 __Pyx_RefNannyFinishContext();
10526 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self) {
10528 PyObject *__pyx_r = NULL;
10529 __Pyx_RefNannyDeclarations
10530 PyObject *__pyx_t_1 = NULL;
10531 PyObject *__pyx_t_2 = NULL;
10532 PyObject *__pyx_t_3 = NULL;
10533 __Pyx_RefNannySetupContext(
"get_memview", 0);
10542 __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
10551 __Pyx_XDECREF(__pyx_r);
10552 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 228, __pyx_L1_error)
10553 __Pyx_GOTREF(__pyx_t_1);
10554 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
10555 __Pyx_GOTREF(__pyx_t_2);
10556 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 228, __pyx_L1_error)
10557 __Pyx_GOTREF(__pyx_t_3);
10558 __Pyx_INCREF(((PyObject *)__pyx_v_self));
10559 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
10560 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
10561 __Pyx_GIVEREF(__pyx_t_1);
10562 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
10563 __Pyx_GIVEREF(__pyx_t_2);
10564 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
10567 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
10568 __Pyx_GOTREF(__pyx_t_2);
10569 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10570 __pyx_r = __pyx_t_2;
10584 __Pyx_XDECREF(__pyx_t_1);
10585 __Pyx_XDECREF(__pyx_t_2);
10586 __Pyx_XDECREF(__pyx_t_3);
10587 __Pyx_AddTraceback(
"View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
10590 __Pyx_XGIVEREF(__pyx_r);
10591 __Pyx_RefNannyFinishContext();
10604 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self);
10605 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
10606 Py_ssize_t __pyx_r;
10607 __Pyx_RefNannyDeclarations
10608 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
10609 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((
struct __pyx_array_obj *)__pyx_v_self));
10612 __Pyx_RefNannyFinishContext();
10616 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self) {
10617 Py_ssize_t __pyx_r;
10618 __Pyx_RefNannyDeclarations
10619 __Pyx_RefNannySetupContext(
"__len__", 0);
10628 __pyx_r = (__pyx_v_self->_shape[0]);
10641 __Pyx_RefNannyFinishContext();
10654 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr);
10655 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
10656 PyObject *__pyx_r = 0;
10657 __Pyx_RefNannyDeclarations
10658 __Pyx_RefNannySetupContext(
"__getattr__ (wrapper)", 0);
10659 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
10662 __Pyx_RefNannyFinishContext();
10666 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
10667 PyObject *__pyx_r = NULL;
10668 __Pyx_RefNannyDeclarations
10669 PyObject *__pyx_t_1 = NULL;
10670 PyObject *__pyx_t_2 = NULL;
10671 __Pyx_RefNannySetupContext(
"__getattr__", 0);
10680 __Pyx_XDECREF(__pyx_r);
10681 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 234, __pyx_L1_error)
10682 __Pyx_GOTREF(__pyx_t_1);
10683 __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 234, __pyx_L1_error)
10684 __Pyx_GOTREF(__pyx_t_2);
10685 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10686 __pyx_r = __pyx_t_2;
10700 __Pyx_XDECREF(__pyx_t_1);
10701 __Pyx_XDECREF(__pyx_t_2);
10702 __Pyx_AddTraceback(
"View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10705 __Pyx_XGIVEREF(__pyx_r);
10706 __Pyx_RefNannyFinishContext();
10719 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item);
10720 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
10721 PyObject *__pyx_r = 0;
10722 __Pyx_RefNannyDeclarations
10723 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
10724 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
10727 __Pyx_RefNannyFinishContext();
10731 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
10732 PyObject *__pyx_r = NULL;
10733 __Pyx_RefNannyDeclarations
10734 PyObject *__pyx_t_1 = NULL;
10735 PyObject *__pyx_t_2 = NULL;
10736 __Pyx_RefNannySetupContext(
"__getitem__", 0);
10745 __Pyx_XDECREF(__pyx_r);
10746 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 237, __pyx_L1_error)
10747 __Pyx_GOTREF(__pyx_t_1);
10748 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 237, __pyx_L1_error)
10749 __Pyx_GOTREF(__pyx_t_2);
10750 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10751 __pyx_r = __pyx_t_2;
10765 __Pyx_XDECREF(__pyx_t_1);
10766 __Pyx_XDECREF(__pyx_t_2);
10767 __Pyx_AddTraceback(
"View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10770 __Pyx_XGIVEREF(__pyx_r);
10771 __Pyx_RefNannyFinishContext();
10784 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
10785 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
10787 __Pyx_RefNannyDeclarations
10788 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
10789 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
10792 __Pyx_RefNannyFinishContext();
10796 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
10798 __Pyx_RefNannyDeclarations
10799 PyObject *__pyx_t_1 = NULL;
10800 __Pyx_RefNannySetupContext(
"__setitem__", 0);
10809 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 240, __pyx_L1_error)
10810 __Pyx_GOTREF(__pyx_t_1);
10811 if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 240, __pyx_L1_error)
10812 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10826 __Pyx_XDECREF(__pyx_t_1);
10827 __Pyx_AddTraceback(
"View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10830 __Pyx_RefNannyFinishContext();
10841 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10842 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10843 PyObject *__pyx_r = 0;
10844 __Pyx_RefNannyDeclarations
10845 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
10846 __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((
struct __pyx_array_obj *)__pyx_v_self));
10849 __Pyx_RefNannyFinishContext();
10853 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self) {
10854 PyObject *__pyx_r = NULL;
10855 __Pyx_RefNannyDeclarations
10856 PyObject *__pyx_t_1 = NULL;
10857 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
10865 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__17, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
10866 __Pyx_GOTREF(__pyx_t_1);
10867 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
10868 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10869 __PYX_ERR(1, 2, __pyx_L1_error)
10879 __Pyx_XDECREF(__pyx_t_1);
10880 __Pyx_AddTraceback(
"View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10882 __Pyx_XGIVEREF(__pyx_r);
10883 __Pyx_RefNannyFinishContext();
10895 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
10896 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10897 PyObject *__pyx_r = 0;
10898 __Pyx_RefNannyDeclarations
10899 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
10900 __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
10903 __Pyx_RefNannyFinishContext();
10907 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
10908 PyObject *__pyx_r = NULL;
10909 __Pyx_RefNannyDeclarations
10910 PyObject *__pyx_t_1 = NULL;
10911 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
10918 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__18, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
10919 __Pyx_GOTREF(__pyx_t_1);
10920 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
10921 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10922 __PYX_ERR(1, 4, __pyx_L1_error)
10933 __Pyx_XDECREF(__pyx_t_1);
10934 __Pyx_AddTraceback(
"View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10936 __Pyx_XGIVEREF(__pyx_r);
10937 __Pyx_RefNannyFinishContext();
10949 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize,
char *__pyx_v_format,
char *__pyx_v_mode,
char *__pyx_v_buf) {
10950 struct __pyx_array_obj *__pyx_v_result = 0;
10951 struct __pyx_array_obj *__pyx_r = NULL;
10952 __Pyx_RefNannyDeclarations
10954 PyObject *__pyx_t_2 = NULL;
10955 PyObject *__pyx_t_3 = NULL;
10956 PyObject *__pyx_t_4 = NULL;
10957 PyObject *__pyx_t_5 = NULL;
10958 __Pyx_RefNannySetupContext(
"array_cwrapper", 0);
10967 __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
10977 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __pyx_L1_error)
10978 __Pyx_GOTREF(__pyx_t_2);
10979 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 249, __pyx_L1_error)
10980 __Pyx_GOTREF(__pyx_t_3);
10981 __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
10982 __Pyx_GOTREF(__pyx_t_4);
10983 __pyx_t_5 = PyTuple_New(4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 249, __pyx_L1_error)
10984 __Pyx_GOTREF(__pyx_t_5);
10985 __Pyx_INCREF(__pyx_v_shape);
10986 __Pyx_GIVEREF(__pyx_v_shape);
10987 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
10988 __Pyx_GIVEREF(__pyx_t_2);
10989 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
10990 __Pyx_GIVEREF(__pyx_t_3);
10991 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
10992 __Pyx_GIVEREF(__pyx_t_4);
10993 PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
10997 __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
10998 __Pyx_GOTREF(__pyx_t_4);
10999 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11000 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_4);
11021 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 251, __pyx_L1_error)
11022 __Pyx_GOTREF(__pyx_t_4);
11023 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
11024 __Pyx_GOTREF(__pyx_t_5);
11025 __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 251, __pyx_L1_error)
11026 __Pyx_GOTREF(__pyx_t_3);
11027 __pyx_t_2 = PyTuple_New(4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 251, __pyx_L1_error)
11028 __Pyx_GOTREF(__pyx_t_2);
11029 __Pyx_INCREF(__pyx_v_shape);
11030 __Pyx_GIVEREF(__pyx_v_shape);
11031 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
11032 __Pyx_GIVEREF(__pyx_t_4);
11033 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
11034 __Pyx_GIVEREF(__pyx_t_5);
11035 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
11036 __Pyx_GIVEREF(__pyx_t_3);
11037 PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
11049 __pyx_t_3 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
11050 __Pyx_GOTREF(__pyx_t_3);
11051 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 252, __pyx_L1_error)
11060 __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
11061 __Pyx_GOTREF(__pyx_t_5);
11062 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11063 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11064 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_5);
11074 __pyx_v_result->data = __pyx_v_buf;
11085 __Pyx_XDECREF(((PyObject *)__pyx_r));
11086 __Pyx_INCREF(((PyObject *)__pyx_v_result));
11087 __pyx_r = __pyx_v_result;
11100 __Pyx_XDECREF(__pyx_t_2);
11101 __Pyx_XDECREF(__pyx_t_3);
11102 __Pyx_XDECREF(__pyx_t_4);
11103 __Pyx_XDECREF(__pyx_t_5);
11104 __Pyx_AddTraceback(
"View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
11107 __Pyx_XDECREF((PyObject *)__pyx_v_result);
11108 __Pyx_XGIVEREF((PyObject *)__pyx_r);
11109 __Pyx_RefNannyFinishContext();
11122 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
11123 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11124 PyObject *__pyx_v_name = 0;
11126 __Pyx_RefNannyDeclarations
11127 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
11129 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
11130 PyObject* values[1] = {0};
11131 if (unlikely(__pyx_kwds)) {
11132 Py_ssize_t kw_args;
11133 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11134 switch (pos_args) {
11135 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11136 CYTHON_FALLTHROUGH;
11138 default:
goto __pyx_L5_argtuple_error;
11140 kw_args = PyDict_Size(__pyx_kwds);
11141 switch (pos_args) {
11143 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
11144 else goto __pyx_L5_argtuple_error;
11146 if (unlikely(kw_args > 0)) {
11147 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(1, 281, __pyx_L3_error)
11149 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
11150 goto __pyx_L5_argtuple_error;
11152 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11154 __pyx_v_name = values[0];
11156 goto __pyx_L4_argument_unpacking_done;
11157 __pyx_L5_argtuple_error:;
11158 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 281, __pyx_L3_error)
11160 __Pyx_AddTraceback(
"View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11161 __Pyx_RefNannyFinishContext();
11163 __pyx_L4_argument_unpacking_done:;
11164 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
11167 __Pyx_RefNannyFinishContext();
11171 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
11173 __Pyx_RefNannyDeclarations
11174 __Pyx_RefNannySetupContext(
"__init__", 0);
11183 __Pyx_INCREF(__pyx_v_name);
11184 __Pyx_GIVEREF(__pyx_v_name);
11185 __Pyx_GOTREF(__pyx_v_self->name);
11186 __Pyx_DECREF(__pyx_v_self->name);
11187 __pyx_v_self->name = __pyx_v_name;
11199 __Pyx_RefNannyFinishContext();
11212 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self);
11213 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
11214 PyObject *__pyx_r = 0;
11215 __Pyx_RefNannyDeclarations
11216 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
11217 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
11220 __Pyx_RefNannyFinishContext();
11224 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
11225 PyObject *__pyx_r = NULL;
11226 __Pyx_RefNannyDeclarations
11227 __Pyx_RefNannySetupContext(
"__repr__", 0);
11236 __Pyx_XDECREF(__pyx_r);
11237 __Pyx_INCREF(__pyx_v_self->name);
11238 __pyx_r = __pyx_v_self->name;
11251 __Pyx_XGIVEREF(__pyx_r);
11252 __Pyx_RefNannyFinishContext();
11263 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
11264 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11265 PyObject *__pyx_r = 0;
11266 __Pyx_RefNannyDeclarations
11267 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
11268 __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
11271 __Pyx_RefNannyFinishContext();
11275 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
11276 PyObject *__pyx_v_state = 0;
11277 PyObject *__pyx_v__dict = 0;
11278 int __pyx_v_use_setstate;
11279 PyObject *__pyx_r = NULL;
11280 __Pyx_RefNannyDeclarations
11281 PyObject *__pyx_t_1 = NULL;
11284 PyObject *__pyx_t_4 = NULL;
11285 PyObject *__pyx_t_5 = NULL;
11286 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
11295 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
11296 __Pyx_GOTREF(__pyx_t_1);
11297 __Pyx_INCREF(__pyx_v_self->name);
11298 __Pyx_GIVEREF(__pyx_v_self->name);
11299 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
11300 __pyx_v_state = ((PyObject*)__pyx_t_1);
11310 __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
11311 __Pyx_GOTREF(__pyx_t_1);
11312 __pyx_v__dict = __pyx_t_1;
11322 __pyx_t_2 = (__pyx_v__dict != Py_None);
11323 __pyx_t_3 = (__pyx_t_2 != 0);
11333 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
11334 __Pyx_GOTREF(__pyx_t_1);
11335 __Pyx_INCREF(__pyx_v__dict);
11336 __Pyx_GIVEREF(__pyx_v__dict);
11337 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
11338 __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
11339 __Pyx_GOTREF(__pyx_t_4);
11340 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11341 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
11351 __pyx_v_use_setstate = 1;
11371 __pyx_t_3 = (__pyx_v_self->name != Py_None);
11372 __pyx_v_use_setstate = __pyx_t_3;
11383 __pyx_t_3 = (__pyx_v_use_setstate != 0);
11393 __Pyx_XDECREF(__pyx_r);
11394 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
11395 __Pyx_GOTREF(__pyx_t_4);
11396 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
11397 __Pyx_GOTREF(__pyx_t_1);
11398 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11399 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11400 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11401 __Pyx_INCREF(__pyx_int_184977713);
11402 __Pyx_GIVEREF(__pyx_int_184977713);
11403 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
11404 __Pyx_INCREF(Py_None);
11405 __Pyx_GIVEREF(Py_None);
11406 PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
11407 __pyx_t_5 = PyTuple_New(3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
11408 __Pyx_GOTREF(__pyx_t_5);
11409 __Pyx_GIVEREF(__pyx_t_4);
11410 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
11411 __Pyx_GIVEREF(__pyx_t_1);
11412 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
11413 __Pyx_INCREF(__pyx_v_state);
11414 __Pyx_GIVEREF(__pyx_v_state);
11415 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
11418 __pyx_r = __pyx_t_5;
11439 __Pyx_XDECREF(__pyx_r);
11440 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
11441 __Pyx_GOTREF(__pyx_t_5);
11442 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
11443 __Pyx_GOTREF(__pyx_t_1);
11444 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11445 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11446 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11447 __Pyx_INCREF(__pyx_int_184977713);
11448 __Pyx_GIVEREF(__pyx_int_184977713);
11449 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
11450 __Pyx_INCREF(__pyx_v_state);
11451 __Pyx_GIVEREF(__pyx_v_state);
11452 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
11453 __pyx_t_4 = PyTuple_New(2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
11454 __Pyx_GOTREF(__pyx_t_4);
11455 __Pyx_GIVEREF(__pyx_t_5);
11456 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
11457 __Pyx_GIVEREF(__pyx_t_1);
11458 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
11461 __pyx_r = __pyx_t_4;
11474 __Pyx_XDECREF(__pyx_t_1);
11475 __Pyx_XDECREF(__pyx_t_4);
11476 __Pyx_XDECREF(__pyx_t_5);
11477 __Pyx_AddTraceback(
"View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11480 __Pyx_XDECREF(__pyx_v_state);
11481 __Pyx_XDECREF(__pyx_v__dict);
11482 __Pyx_XGIVEREF(__pyx_r);
11483 __Pyx_RefNannyFinishContext();
11495 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
11496 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
11497 PyObject *__pyx_r = 0;
11498 __Pyx_RefNannyDeclarations
11499 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
11500 __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
11503 __Pyx_RefNannyFinishContext();
11507 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
11508 PyObject *__pyx_r = NULL;
11509 __Pyx_RefNannyDeclarations
11510 PyObject *__pyx_t_1 = NULL;
11511 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
11518 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
11519 __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
11520 __Pyx_GOTREF(__pyx_t_1);
11521 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11531 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11534 __Pyx_XDECREF(__pyx_t_1);
11535 __Pyx_AddTraceback(
"View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11538 __Pyx_XGIVEREF(__pyx_r);
11539 __Pyx_RefNannyFinishContext();
11551 static void *__pyx_align_pointer(
void *__pyx_v_memory,
size_t __pyx_v_alignment) {
11552 Py_intptr_t __pyx_v_aligned_p;
11553 size_t __pyx_v_offset;
11564 __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
11573 __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
11582 __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
11592 __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
11610 __pyx_r = ((
void *)__pyx_v_aligned_p);
11635 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
11636 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11637 PyObject *__pyx_v_obj = 0;
11639 int __pyx_v_dtype_is_object;
11641 __Pyx_RefNannyDeclarations
11642 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
11644 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
11645 PyObject* values[3] = {0,0,0};
11646 if (unlikely(__pyx_kwds)) {
11647 Py_ssize_t kw_args;
11648 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11649 switch (pos_args) {
11650 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11651 CYTHON_FALLTHROUGH;
11652 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11653 CYTHON_FALLTHROUGH;
11654 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11655 CYTHON_FALLTHROUGH;
11657 default:
goto __pyx_L5_argtuple_error;
11659 kw_args = PyDict_Size(__pyx_kwds);
11660 switch (pos_args) {
11662 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
11663 else goto __pyx_L5_argtuple_error;
11664 CYTHON_FALLTHROUGH;
11666 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
11668 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 345, __pyx_L3_error)
11670 CYTHON_FALLTHROUGH;
11673 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
11674 if (value) { values[2] = value; kw_args--; }
11677 if (unlikely(kw_args > 0)) {
11678 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(1, 345, __pyx_L3_error)
11681 switch (PyTuple_GET_SIZE(__pyx_args)) {
11682 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11683 CYTHON_FALLTHROUGH;
11684 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11685 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11687 default:
goto __pyx_L5_argtuple_error;
11690 __pyx_v_obj = values[0];
11691 __pyx_v_flags = __Pyx_PyInt_As_int(values[1]);
if (unlikely((__pyx_v_flags == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
11693 __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]);
if (unlikely((__pyx_v_dtype_is_object == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
11695 __pyx_v_dtype_is_object = ((int)0);
11698 goto __pyx_L4_argument_unpacking_done;
11699 __pyx_L5_argtuple_error:;
11700 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 345, __pyx_L3_error)
11702 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11703 __Pyx_RefNannyFinishContext();
11705 __pyx_L4_argument_unpacking_done:;
11706 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
11709 __Pyx_RefNannyFinishContext();
11713 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj,
int __pyx_v_flags,
int __pyx_v_dtype_is_object) {
11715 __Pyx_RefNannyDeclarations
11720 __Pyx_RefNannySetupContext(
"__cinit__", 0);
11729 __Pyx_INCREF(__pyx_v_obj);
11730 __Pyx_GIVEREF(__pyx_v_obj);
11731 __Pyx_GOTREF(__pyx_v_self->obj);
11732 __Pyx_DECREF(__pyx_v_self->obj);
11733 __pyx_v_self->obj = __pyx_v_obj;
11742 __pyx_v_self->flags = __pyx_v_flags;
11751 __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
11752 __pyx_t_3 = (__pyx_t_2 != 0);
11755 __pyx_t_1 = __pyx_t_3;
11756 goto __pyx_L4_bool_binop_done;
11758 __pyx_t_3 = (__pyx_v_obj != Py_None);
11759 __pyx_t_2 = (__pyx_t_3 != 0);
11760 __pyx_t_1 = __pyx_t_2;
11761 __pyx_L4_bool_binop_done:;
11771 __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 349, __pyx_L1_error)
11780 __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
11790 ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
11799 Py_INCREF(Py_None);
11826 __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
11836 __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
11845 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
11863 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
11873 __pyx_v_self->lock = PyThread_allocate_lock();
11882 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
11883 if (unlikely(__pyx_t_1)) {
11892 PyErr_NoMemory(); __PYX_ERR(1, 361, __pyx_L1_error)
11919 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
11929 __pyx_t_2 = (((__pyx_v_self->view.format[0]) ==
'O') != 0);
11932 __pyx_t_1 = __pyx_t_2;
11933 goto __pyx_L11_bool_binop_done;
11935 __pyx_t_2 = (((__pyx_v_self->view.format[1]) ==
'\x00') != 0);
11936 __pyx_t_1 = __pyx_t_2;
11937 __pyx_L11_bool_binop_done:;
11938 __pyx_v_self->dtype_is_object = __pyx_t_1;
11958 __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
11969 __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((
void *)(&(__pyx_v_self->acquisition_count[0]))), (
sizeof(__pyx_atomic_int))));
11978 __pyx_v_self->typeinfo = NULL;
11992 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11995 __Pyx_RefNannyFinishContext();
12008 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self);
12009 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
12010 __Pyx_RefNannyDeclarations
12011 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
12012 __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12015 __Pyx_RefNannyFinishContext();
12018 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12020 __Pyx_RefNannyDeclarations
12026 PyThread_type_lock __pyx_t_6;
12027 PyThread_type_lock __pyx_t_7;
12028 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
12037 __pyx_t_1 = (__pyx_v_self->obj != Py_None);
12038 __pyx_t_2 = (__pyx_t_1 != 0);
12048 __Pyx_ReleaseBuffer((&__pyx_v_self->view));
12067 __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
12077 ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
12086 Py_DECREF(Py_None);
12105 __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
12115 __pyx_t_3 = __pyx_memoryview_thread_locks_used;
12116 __pyx_t_4 = __pyx_t_3;
12117 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
12118 __pyx_v_i = __pyx_t_5;
12127 __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
12137 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
12146 __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
12156 __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
12157 __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
12166 (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
12167 (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
12185 goto __pyx_L6_break;
12205 PyThread_free_lock(__pyx_v_self->lock);
12227 __Pyx_RefNannyFinishContext();
12238 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
12239 Py_ssize_t __pyx_v_dim;
12240 char *__pyx_v_itemp;
12241 PyObject *__pyx_v_idx = NULL;
12243 __Pyx_RefNannyDeclarations
12244 Py_ssize_t __pyx_t_1;
12245 PyObject *__pyx_t_2 = NULL;
12246 Py_ssize_t __pyx_t_3;
12247 PyObject *(*__pyx_t_4)(PyObject *);
12248 PyObject *__pyx_t_5 = NULL;
12249 Py_ssize_t __pyx_t_6;
12251 __Pyx_RefNannySetupContext(
"get_item_pointer", 0);
12260 __pyx_v_itemp = ((
char *)__pyx_v_self->view.buf);
12270 if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
12271 __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
12274 __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 397, __pyx_L1_error)
12275 __Pyx_GOTREF(__pyx_t_2);
12276 __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 397, __pyx_L1_error)
12279 if (likely(!__pyx_t_4)) {
12280 if (likely(PyList_CheckExact(__pyx_t_2))) {
12281 if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2))
break;
12282 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 12283 __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
12285 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
12286 __Pyx_GOTREF(__pyx_t_5);
12289 if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2))
break;
12290 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 12291 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
12293 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
12294 __Pyx_GOTREF(__pyx_t_5);
12298 __pyx_t_5 = __pyx_t_4(__pyx_t_2);
12299 if (unlikely(!__pyx_t_5)) {
12300 PyObject* exc_type = PyErr_Occurred();
12302 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
12303 else __PYX_ERR(1, 397, __pyx_L1_error)
12307 __Pyx_GOTREF(__pyx_t_5);
12309 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
12311 __pyx_v_dim = __pyx_t_1;
12312 __pyx_t_1 = (__pyx_t_1 + 1);
12321 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 398, __pyx_L1_error)
12322 __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim);
if (unlikely(__pyx_t_7 == ((
char *)NULL))) __PYX_ERR(1, 398, __pyx_L1_error)
12323 __pyx_v_itemp = __pyx_t_7;
12333 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12342 __pyx_r = __pyx_v_itemp;
12355 __Pyx_XDECREF(__pyx_t_2);
12356 __Pyx_XDECREF(__pyx_t_5);
12357 __Pyx_AddTraceback(
"View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
12360 __Pyx_XDECREF(__pyx_v_idx);
12361 __Pyx_RefNannyFinishContext();
12374 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index);
12375 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
12376 PyObject *__pyx_r = 0;
12377 __Pyx_RefNannyDeclarations
12378 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
12379 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
12382 __Pyx_RefNannyFinishContext();
12386 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
12387 PyObject *__pyx_v_have_slices = NULL;
12388 PyObject *__pyx_v_indices = NULL;
12389 char *__pyx_v_itemp;
12390 PyObject *__pyx_r = NULL;
12391 __Pyx_RefNannyDeclarations
12394 PyObject *__pyx_t_3 = NULL;
12395 PyObject *__pyx_t_4 = NULL;
12396 PyObject *__pyx_t_5 = NULL;
12398 __Pyx_RefNannySetupContext(
"__getitem__", 0);
12407 __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
12408 __pyx_t_2 = (__pyx_t_1 != 0);
12418 __Pyx_XDECREF(__pyx_r);
12419 __Pyx_INCREF(((PyObject *)__pyx_v_self));
12420 __pyx_r = ((PyObject *)__pyx_v_self);
12439 __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 407, __pyx_L1_error)
12440 __Pyx_GOTREF(__pyx_t_3);
12441 if (likely(__pyx_t_3 != Py_None)) {
12442 PyObject* sequence = __pyx_t_3;
12443 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
12444 if (unlikely(size != 2)) {
12445 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
12446 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
12447 __PYX_ERR(1, 407, __pyx_L1_error)
12449 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 12450 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
12451 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
12452 __Pyx_INCREF(__pyx_t_4);
12453 __Pyx_INCREF(__pyx_t_5);
12455 __pyx_t_4 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 407, __pyx_L1_error)
12456 __Pyx_GOTREF(__pyx_t_4);
12457 __pyx_t_5 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 407, __pyx_L1_error)
12458 __Pyx_GOTREF(__pyx_t_5);
12460 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12462 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 407, __pyx_L1_error)
12464 __pyx_v_have_slices = __pyx_t_4;
12466 __pyx_v_indices = __pyx_t_5;
12476 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 410, __pyx_L1_error)
12486 __Pyx_XDECREF(__pyx_r);
12487 __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 411, __pyx_L1_error)
12488 __Pyx_GOTREF(__pyx_t_3);
12489 __pyx_r = __pyx_t_3;
12510 __pyx_t_6 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices);
if (unlikely(__pyx_t_6 == ((
char *)NULL))) __PYX_ERR(1, 413, __pyx_L1_error)
12511 __pyx_v_itemp = __pyx_t_6;
12520 __Pyx_XDECREF(__pyx_r);
12521 __pyx_t_3 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 414, __pyx_L1_error)
12522 __Pyx_GOTREF(__pyx_t_3);
12523 __pyx_r = __pyx_t_3;
12538 __Pyx_XDECREF(__pyx_t_3);
12539 __Pyx_XDECREF(__pyx_t_4);
12540 __Pyx_XDECREF(__pyx_t_5);
12541 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12544 __Pyx_XDECREF(__pyx_v_have_slices);
12545 __Pyx_XDECREF(__pyx_v_indices);
12546 __Pyx_XGIVEREF(__pyx_r);
12547 __Pyx_RefNannyFinishContext();
12560 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
12561 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
12563 __Pyx_RefNannyDeclarations
12564 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
12565 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
12568 __Pyx_RefNannyFinishContext();
12572 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
12573 PyObject *__pyx_v_have_slices = NULL;
12574 PyObject *__pyx_v_obj = NULL;
12576 __Pyx_RefNannyDeclarations
12578 PyObject *__pyx_t_2 = NULL;
12579 PyObject *__pyx_t_3 = NULL;
12580 PyObject *__pyx_t_4 = NULL;
12581 __Pyx_RefNannySetupContext(
"__setitem__", 0);
12582 __Pyx_INCREF(__pyx_v_index);
12591 __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
12592 if (unlikely(__pyx_t_1)) {
12601 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__19, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error)
12602 __Pyx_GOTREF(__pyx_t_2);
12603 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
12604 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12605 __PYX_ERR(1, 418, __pyx_L1_error)
12623 __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error)
12624 __Pyx_GOTREF(__pyx_t_2);
12625 if (likely(__pyx_t_2 != Py_None)) {
12626 PyObject* sequence = __pyx_t_2;
12627 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
12628 if (unlikely(size != 2)) {
12629 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
12630 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
12631 __PYX_ERR(1, 420, __pyx_L1_error)
12633 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 12634 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
12635 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
12636 __Pyx_INCREF(__pyx_t_3);
12637 __Pyx_INCREF(__pyx_t_4);
12639 __pyx_t_3 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 420, __pyx_L1_error)
12640 __Pyx_GOTREF(__pyx_t_3);
12641 __pyx_t_4 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 420, __pyx_L1_error)
12642 __Pyx_GOTREF(__pyx_t_4);
12644 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12646 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 420, __pyx_L1_error)
12648 __pyx_v_have_slices = __pyx_t_3;
12650 __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
12660 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 422, __pyx_L1_error)
12670 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 423, __pyx_L1_error)
12671 __Pyx_GOTREF(__pyx_t_2);
12672 __pyx_v_obj = __pyx_t_2;
12682 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 424, __pyx_L1_error)
12692 __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 425, __pyx_L1_error)
12693 __Pyx_GOTREF(__pyx_t_2);
12694 __pyx_t_4 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 425, __pyx_L1_error)
12695 __Pyx_GOTREF(__pyx_t_4);
12696 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12697 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12717 __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 427, __pyx_L1_error)
12718 __Pyx_GOTREF(__pyx_t_4);
12719 if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 427, __pyx_L1_error)
12720 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((
struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 427, __pyx_L1_error)
12721 __Pyx_GOTREF(__pyx_t_2);
12722 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12723 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12745 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 429, __pyx_L1_error)
12746 __Pyx_GOTREF(__pyx_t_2);
12747 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12763 __Pyx_XDECREF(__pyx_t_2);
12764 __Pyx_XDECREF(__pyx_t_3);
12765 __Pyx_XDECREF(__pyx_t_4);
12766 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12769 __Pyx_XDECREF(__pyx_v_have_slices);
12770 __Pyx_XDECREF(__pyx_v_obj);
12771 __Pyx_XDECREF(__pyx_v_index);
12772 __Pyx_RefNannyFinishContext();
12784 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
12785 PyObject *__pyx_r = NULL;
12786 __Pyx_RefNannyDeclarations
12789 PyObject *__pyx_t_3 = NULL;
12790 PyObject *__pyx_t_4 = NULL;
12791 PyObject *__pyx_t_5 = NULL;
12792 PyObject *__pyx_t_6 = NULL;
12793 PyObject *__pyx_t_7 = NULL;
12794 PyObject *__pyx_t_8 = NULL;
12796 __Pyx_RefNannySetupContext(
"is_slice", 0);
12797 __Pyx_INCREF(__pyx_v_obj);
12806 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
12807 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
12818 __Pyx_PyThreadState_declare
12819 __Pyx_PyThreadState_assign
12820 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
12821 __Pyx_XGOTREF(__pyx_t_3);
12822 __Pyx_XGOTREF(__pyx_t_4);
12823 __Pyx_XGOTREF(__pyx_t_5);
12833 __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 434, __pyx_L4_error)
12834 __Pyx_GOTREF(__pyx_t_6);
12843 __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 435, __pyx_L4_error)
12844 __Pyx_GOTREF(__pyx_t_7);
12853 __pyx_t_8 = PyTuple_New(3);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 434, __pyx_L4_error)
12854 __Pyx_GOTREF(__pyx_t_8);
12855 __Pyx_INCREF(__pyx_v_obj);
12856 __Pyx_GIVEREF(__pyx_v_obj);
12857 PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
12858 __Pyx_GIVEREF(__pyx_t_6);
12859 PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
12860 __Pyx_GIVEREF(__pyx_t_7);
12861 PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
12864 __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 434, __pyx_L4_error)
12865 __Pyx_GOTREF(__pyx_t_7);
12866 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12867 __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
12878 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12879 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12880 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12881 goto __pyx_L9_try_end;
12883 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12884 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12885 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
12894 __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
12896 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
12897 if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 436, __pyx_L6_except_error)
12898 __Pyx_GOTREF(__pyx_t_7);
12899 __Pyx_GOTREF(__pyx_t_8);
12900 __Pyx_GOTREF(__pyx_t_6);
12909 __Pyx_XDECREF(__pyx_r);
12910 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12911 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12912 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12913 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12914 goto __pyx_L7_except_return;
12916 goto __pyx_L6_except_error;
12917 __pyx_L6_except_error:;
12926 __Pyx_XGIVEREF(__pyx_t_3);
12927 __Pyx_XGIVEREF(__pyx_t_4);
12928 __Pyx_XGIVEREF(__pyx_t_5);
12929 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
12930 goto __pyx_L1_error;
12931 __pyx_L7_except_return:;
12932 __Pyx_XGIVEREF(__pyx_t_3);
12933 __Pyx_XGIVEREF(__pyx_t_4);
12934 __Pyx_XGIVEREF(__pyx_t_5);
12935 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
12956 __Pyx_XDECREF(__pyx_r);
12957 __Pyx_INCREF(__pyx_v_obj);
12958 __pyx_r = __pyx_v_obj;
12971 __Pyx_XDECREF(__pyx_t_6);
12972 __Pyx_XDECREF(__pyx_t_7);
12973 __Pyx_XDECREF(__pyx_t_8);
12974 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
12977 __Pyx_XDECREF(__pyx_v_obj);
12978 __Pyx_XGIVEREF(__pyx_r);
12979 __Pyx_RefNannyFinishContext();
12991 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
12992 __Pyx_memviewslice __pyx_v_dst_slice;
12993 __Pyx_memviewslice __pyx_v_src_slice;
12994 PyObject *__pyx_r = NULL;
12995 __Pyx_RefNannyDeclarations
12996 __Pyx_memviewslice *__pyx_t_1;
12997 __Pyx_memviewslice *__pyx_t_2;
12998 PyObject *__pyx_t_3 = NULL;
13002 __Pyx_RefNannySetupContext(
"setitem_slice_assignment", 0);
13011 if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 445, __pyx_L1_error)
13012 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((
struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 445, __pyx_L1_error)
13021 if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 446, __pyx_L1_error)
13022 __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((
struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice));
if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 446, __pyx_L1_error)
13031 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
13032 __Pyx_GOTREF(__pyx_t_3);
13033 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
13034 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13035 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
13036 __Pyx_GOTREF(__pyx_t_3);
13037 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
13038 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13047 __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 445, __pyx_L1_error)
13058 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13061 __Pyx_XDECREF(__pyx_t_3);
13062 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
13065 __Pyx_XGIVEREF(__pyx_r);
13066 __Pyx_RefNannyFinishContext();
13078 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(
struct __pyx_memoryview_obj *__pyx_v_self,
struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
13079 int __pyx_v_array[0x80];
13081 void *__pyx_v_item;
13082 __Pyx_memviewslice *__pyx_v_dst_slice;
13083 __Pyx_memviewslice __pyx_v_tmp_slice;
13084 PyObject *__pyx_r = NULL;
13085 __Pyx_RefNannyDeclarations
13086 __Pyx_memviewslice *__pyx_t_1;
13088 PyObject *__pyx_t_3 = NULL;
13091 char const *__pyx_t_6;
13092 PyObject *__pyx_t_7 = NULL;
13093 PyObject *__pyx_t_8 = NULL;
13094 PyObject *__pyx_t_9 = NULL;
13095 PyObject *__pyx_t_10 = NULL;
13096 PyObject *__pyx_t_11 = NULL;
13097 PyObject *__pyx_t_12 = NULL;
13098 __Pyx_RefNannySetupContext(
"setitem_slice_assign_scalar", 0);
13107 __pyx_v_tmp = NULL;
13116 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 456, __pyx_L1_error)
13117 __pyx_v_dst_slice = __pyx_t_1;
13126 __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (
sizeof(__pyx_v_array))) != 0);
13136 __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
13145 __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
13146 if (unlikely(__pyx_t_2)) {
13155 PyErr_NoMemory(); __PYX_ERR(1, 461, __pyx_L1_error)
13173 __pyx_v_item = __pyx_v_tmp;
13193 __pyx_v_item = ((
void *)__pyx_v_array);
13213 __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
13223 (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
13243 __pyx_t_3 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((
char *)__pyx_v_item), __pyx_v_value);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 470, __pyx_L6_error)
13244 __Pyx_GOTREF(__pyx_t_3);
13245 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13256 __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
13266 __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 475, __pyx_L6_error)
13267 __Pyx_GOTREF(__pyx_t_3);
13268 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13286 __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
13298 PyMem_Free(__pyx_v_tmp);
13303 __Pyx_PyThreadState_declare
13304 __Pyx_PyThreadState_assign
13305 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
13306 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13307 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
13308 if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
13309 __Pyx_XGOTREF(__pyx_t_7);
13310 __Pyx_XGOTREF(__pyx_t_8);
13311 __Pyx_XGOTREF(__pyx_t_9);
13312 __Pyx_XGOTREF(__pyx_t_10);
13313 __Pyx_XGOTREF(__pyx_t_11);
13314 __Pyx_XGOTREF(__pyx_t_12);
13315 __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
13317 PyMem_Free(__pyx_v_tmp);
13319 if (PY_MAJOR_VERSION >= 3) {
13320 __Pyx_XGIVEREF(__pyx_t_10);
13321 __Pyx_XGIVEREF(__pyx_t_11);
13322 __Pyx_XGIVEREF(__pyx_t_12);
13323 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
13325 __Pyx_XGIVEREF(__pyx_t_7);
13326 __Pyx_XGIVEREF(__pyx_t_8);
13327 __Pyx_XGIVEREF(__pyx_t_9);
13328 __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
13329 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
13330 __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
13331 goto __pyx_L1_error;
13345 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13348 __Pyx_XDECREF(__pyx_t_3);
13349 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
13352 __Pyx_XGIVEREF(__pyx_r);
13353 __Pyx_RefNannyFinishContext();
13365 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
13366 char *__pyx_v_itemp;
13367 PyObject *__pyx_r = NULL;
13368 __Pyx_RefNannyDeclarations
13370 PyObject *__pyx_t_2 = NULL;
13371 __Pyx_RefNannySetupContext(
"setitem_indexed", 0);
13380 __pyx_t_1 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index);
if (unlikely(__pyx_t_1 == ((
char *)NULL))) __PYX_ERR(1, 482, __pyx_L1_error)
13381 __pyx_v_itemp = __pyx_t_1;
13390 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 483, __pyx_L1_error)
13391 __Pyx_GOTREF(__pyx_t_2);
13392 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13403 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13406 __Pyx_XDECREF(__pyx_t_2);
13407 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
13410 __Pyx_XGIVEREF(__pyx_r);
13411 __Pyx_RefNannyFinishContext();
13423 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp) {
13424 PyObject *__pyx_v_struct = NULL;
13425 PyObject *__pyx_v_bytesitem = 0;
13426 PyObject *__pyx_v_result = NULL;
13427 PyObject *__pyx_r = NULL;
13428 __Pyx_RefNannyDeclarations
13429 PyObject *__pyx_t_1 = NULL;
13430 PyObject *__pyx_t_2 = NULL;
13431 PyObject *__pyx_t_3 = NULL;
13432 PyObject *__pyx_t_4 = NULL;
13433 PyObject *__pyx_t_5 = NULL;
13434 PyObject *__pyx_t_6 = NULL;
13435 PyObject *__pyx_t_7 = NULL;
13437 PyObject *__pyx_t_9 = NULL;
13440 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
13449 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L1_error)
13450 __Pyx_GOTREF(__pyx_t_1);
13451 __pyx_v_struct = __pyx_t_1;
13461 __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 491, __pyx_L1_error)
13462 __Pyx_GOTREF(__pyx_t_1);
13463 __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
13474 __Pyx_PyThreadState_declare
13475 __Pyx_PyThreadState_assign
13476 __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
13477 __Pyx_XGOTREF(__pyx_t_2);
13478 __Pyx_XGOTREF(__pyx_t_3);
13479 __Pyx_XGOTREF(__pyx_t_4);
13489 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 493, __pyx_L3_error)
13490 __Pyx_GOTREF(__pyx_t_5);
13491 __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 493, __pyx_L3_error)
13492 __Pyx_GOTREF(__pyx_t_6);
13495 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
13496 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
13497 if (likely(__pyx_t_7)) {
13498 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
13499 __Pyx_INCREF(__pyx_t_7);
13500 __Pyx_INCREF(
function);
13501 __Pyx_DECREF_SET(__pyx_t_5,
function);
13505 #if CYTHON_FAST_PYCALL 13506 if (PyFunction_Check(__pyx_t_5)) {
13507 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
13508 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
13509 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
13510 __Pyx_GOTREF(__pyx_t_1);
13511 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13514 #if CYTHON_FAST_PYCCALL 13515 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
13516 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
13517 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
13518 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
13519 __Pyx_GOTREF(__pyx_t_1);
13520 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13524 __pyx_t_9 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 493, __pyx_L3_error)
13525 __Pyx_GOTREF(__pyx_t_9);
13527 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
13529 __Pyx_GIVEREF(__pyx_t_6);
13530 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
13531 __Pyx_INCREF(__pyx_v_bytesitem);
13532 __Pyx_GIVEREF(__pyx_v_bytesitem);
13533 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
13535 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
13536 __Pyx_GOTREF(__pyx_t_1);
13537 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13539 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13540 __pyx_v_result = __pyx_t_1;
13560 __pyx_t_10 = strlen(__pyx_v_self->view.format);
13561 __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
13571 __Pyx_XDECREF(__pyx_r);
13572 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 498, __pyx_L5_except_error)
13573 __Pyx_GOTREF(__pyx_t_1);
13574 __pyx_r = __pyx_t_1;
13576 goto __pyx_L6_except_return;
13594 __Pyx_XDECREF(__pyx_r);
13595 __Pyx_INCREF(__pyx_v_result);
13596 __pyx_r = __pyx_v_result;
13597 goto __pyx_L6_except_return;
13600 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
13601 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13602 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
13603 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
13604 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
13613 __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
13614 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 494, __pyx_L5_except_error)
13615 __Pyx_GOTREF(__pyx_t_6);
13616 __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
13617 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13618 __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
13619 __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
13621 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
13622 if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 494, __pyx_L5_except_error)
13623 __Pyx_GOTREF(__pyx_t_9);
13624 __Pyx_GOTREF(__pyx_t_5);
13625 __Pyx_GOTREF(__pyx_t_1);
13634 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 495, __pyx_L5_except_error)
13635 __Pyx_GOTREF(__pyx_t_6);
13636 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
13637 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13638 __PYX_ERR(1, 495, __pyx_L5_except_error)
13640 goto __pyx_L5_except_error;
13641 __pyx_L5_except_error:;
13650 __Pyx_XGIVEREF(__pyx_t_2);
13651 __Pyx_XGIVEREF(__pyx_t_3);
13652 __Pyx_XGIVEREF(__pyx_t_4);
13653 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
13654 goto __pyx_L1_error;
13655 __pyx_L6_except_return:;
13656 __Pyx_XGIVEREF(__pyx_t_2);
13657 __Pyx_XGIVEREF(__pyx_t_3);
13658 __Pyx_XGIVEREF(__pyx_t_4);
13659 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
13673 __Pyx_XDECREF(__pyx_t_1);
13674 __Pyx_XDECREF(__pyx_t_5);
13675 __Pyx_XDECREF(__pyx_t_6);
13676 __Pyx_XDECREF(__pyx_t_7);
13677 __Pyx_XDECREF(__pyx_t_9);
13678 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
13681 __Pyx_XDECREF(__pyx_v_struct);
13682 __Pyx_XDECREF(__pyx_v_bytesitem);
13683 __Pyx_XDECREF(__pyx_v_result);
13684 __Pyx_XGIVEREF(__pyx_r);
13685 __Pyx_RefNannyFinishContext();
13697 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
13698 PyObject *__pyx_v_struct = NULL;
13700 PyObject *__pyx_v_bytesvalue = 0;
13701 Py_ssize_t __pyx_v_i;
13702 PyObject *__pyx_r = NULL;
13703 __Pyx_RefNannyDeclarations
13704 PyObject *__pyx_t_1 = NULL;
13707 PyObject *__pyx_t_4 = NULL;
13708 PyObject *__pyx_t_5 = NULL;
13709 PyObject *__pyx_t_6 = NULL;
13711 PyObject *__pyx_t_8 = NULL;
13712 Py_ssize_t __pyx_t_9;
13713 PyObject *__pyx_t_10 = NULL;
13718 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
13727 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 504, __pyx_L1_error)
13728 __Pyx_GOTREF(__pyx_t_1);
13729 __pyx_v_struct = __pyx_t_1;
13739 __pyx_t_2 = PyTuple_Check(__pyx_v_value);
13740 __pyx_t_3 = (__pyx_t_2 != 0);
13750 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 510, __pyx_L1_error)
13751 __Pyx_GOTREF(__pyx_t_1);
13752 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
13753 __Pyx_GOTREF(__pyx_t_4);
13754 __pyx_t_5 = PyTuple_New(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 510, __pyx_L1_error)
13755 __Pyx_GOTREF(__pyx_t_5);
13756 __Pyx_GIVEREF(__pyx_t_4);
13757 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
13759 __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
13760 __Pyx_GOTREF(__pyx_t_4);
13761 __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 510, __pyx_L1_error)
13762 __Pyx_GOTREF(__pyx_t_6);
13763 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13764 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13765 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
13766 __Pyx_GOTREF(__pyx_t_4);
13767 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13768 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13769 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 510, __pyx_L1_error)
13770 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
13791 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 512, __pyx_L1_error)
13792 __Pyx_GOTREF(__pyx_t_6);
13793 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 512, __pyx_L1_error)
13794 __Pyx_GOTREF(__pyx_t_1);
13797 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
13798 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
13799 if (likely(__pyx_t_5)) {
13800 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
13801 __Pyx_INCREF(__pyx_t_5);
13802 __Pyx_INCREF(
function);
13803 __Pyx_DECREF_SET(__pyx_t_6,
function);
13807 #if CYTHON_FAST_PYCALL 13808 if (PyFunction_Check(__pyx_t_6)) {
13809 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
13810 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
13811 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13812 __Pyx_GOTREF(__pyx_t_4);
13813 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13816 #if CYTHON_FAST_PYCCALL 13817 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
13818 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
13819 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
13820 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13821 __Pyx_GOTREF(__pyx_t_4);
13822 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13826 __pyx_t_8 = PyTuple_New(2+__pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 512, __pyx_L1_error)
13827 __Pyx_GOTREF(__pyx_t_8);
13829 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
13831 __Pyx_GIVEREF(__pyx_t_1);
13832 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
13833 __Pyx_INCREF(__pyx_v_value);
13834 __Pyx_GIVEREF(__pyx_v_value);
13835 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
13837 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
13838 __Pyx_GOTREF(__pyx_t_4);
13839 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13841 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13842 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 512, __pyx_L1_error)
13843 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
13856 if (unlikely(__pyx_v_bytesvalue == Py_None)) {
13857 PyErr_SetString(PyExc_TypeError,
"'NoneType' is not iterable");
13858 __PYX_ERR(1, 514, __pyx_L1_error)
13860 __Pyx_INCREF(__pyx_v_bytesvalue);
13861 __pyx_t_10 = __pyx_v_bytesvalue;
13862 __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
13863 __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
13864 for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
13865 __pyx_t_11 = __pyx_t_14;
13866 __pyx_v_c = (__pyx_t_11[0]);
13875 __pyx_v_i = __pyx_t_9;
13884 __pyx_t_9 = (__pyx_t_9 + 1);
13893 (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
13895 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13906 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13909 __Pyx_XDECREF(__pyx_t_1);
13910 __Pyx_XDECREF(__pyx_t_4);
13911 __Pyx_XDECREF(__pyx_t_5);
13912 __Pyx_XDECREF(__pyx_t_6);
13913 __Pyx_XDECREF(__pyx_t_8);
13914 __Pyx_XDECREF(__pyx_t_10);
13915 __Pyx_AddTraceback(
"View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
13918 __Pyx_XDECREF(__pyx_v_struct);
13919 __Pyx_XDECREF(__pyx_v_bytesvalue);
13920 __Pyx_XGIVEREF(__pyx_r);
13921 __Pyx_RefNannyFinishContext();
13934 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
13935 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
13937 __Pyx_RefNannyDeclarations
13938 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
13939 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
13942 __Pyx_RefNannyFinishContext();
13946 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(
struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
13948 __Pyx_RefNannyDeclarations
13951 PyObject *__pyx_t_3 = NULL;
13952 Py_ssize_t *__pyx_t_4;
13956 Py_ssize_t __pyx_t_8;
13957 if (__pyx_v_info == NULL) {
13958 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
13961 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
13962 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
13963 __Pyx_GIVEREF(__pyx_v_info->obj);
13972 __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
13975 __pyx_t_1 = __pyx_t_2;
13976 goto __pyx_L4_bool_binop_done;
13978 __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
13979 __pyx_t_1 = __pyx_t_2;
13980 __pyx_L4_bool_binop_done:;
13981 if (unlikely(__pyx_t_1)) {
13990 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 520, __pyx_L1_error)
13991 __Pyx_GOTREF(__pyx_t_3);
13992 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
13993 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13994 __PYX_ERR(1, 520, __pyx_L1_error)
14012 __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
14022 __pyx_t_4 = __pyx_v_self->view.shape;
14023 __pyx_v_info->shape = __pyx_t_4;
14043 __pyx_v_info->shape = NULL;
14054 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
14064 __pyx_t_4 = __pyx_v_self->view.strides;
14065 __pyx_v_info->strides = __pyx_t_4;
14085 __pyx_v_info->strides = NULL;
14096 __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
14106 __pyx_t_4 = __pyx_v_self->view.suboffsets;
14107 __pyx_v_info->suboffsets = __pyx_t_4;
14127 __pyx_v_info->suboffsets = NULL;
14138 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
14148 __pyx_t_5 = __pyx_v_self->view.format;
14149 __pyx_v_info->format = __pyx_t_5;
14169 __pyx_v_info->format = NULL;
14180 __pyx_t_6 = __pyx_v_self->view.buf;
14181 __pyx_v_info->buf = __pyx_t_6;
14190 __pyx_t_7 = __pyx_v_self->view.ndim;
14191 __pyx_v_info->ndim = __pyx_t_7;
14200 __pyx_t_8 = __pyx_v_self->view.itemsize;
14201 __pyx_v_info->itemsize = __pyx_t_8;
14210 __pyx_t_8 = __pyx_v_self->view.len;
14211 __pyx_v_info->len = __pyx_t_8;
14220 __pyx_t_1 = __pyx_v_self->view.readonly;
14221 __pyx_v_info->readonly = __pyx_t_1;
14230 __Pyx_INCREF(((PyObject *)__pyx_v_self));
14231 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
14232 __Pyx_GOTREF(__pyx_v_info->obj);
14233 __Pyx_DECREF(__pyx_v_info->obj);
14234 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
14248 __Pyx_XDECREF(__pyx_t_3);
14249 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14251 if (__pyx_v_info->obj != NULL) {
14252 __Pyx_GOTREF(__pyx_v_info->obj);
14253 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
14257 if (__pyx_v_info->obj == Py_None) {
14258 __Pyx_GOTREF(__pyx_v_info->obj);
14259 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
14262 __Pyx_RefNannyFinishContext();
14275 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self);
14276 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
14277 PyObject *__pyx_r = 0;
14278 __Pyx_RefNannyDeclarations
14279 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
14280 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14283 __Pyx_RefNannyFinishContext();
14287 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14288 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
14289 PyObject *__pyx_r = NULL;
14290 __Pyx_RefNannyDeclarations
14291 PyObject *__pyx_t_1 = NULL;
14293 __Pyx_RefNannySetupContext(
"__get__", 0);
14302 __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 554, __pyx_L1_error)
14303 __Pyx_GOTREF(__pyx_t_1);
14304 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 554, __pyx_L1_error)
14305 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_1);
14315 __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice));
if (unlikely(__pyx_t_2 == ((
int)0))) __PYX_ERR(1, 555, __pyx_L1_error)
14324 __Pyx_XDECREF(__pyx_r);
14325 __Pyx_INCREF(((PyObject *)__pyx_v_result));
14326 __pyx_r = ((PyObject *)__pyx_v_result);
14339 __Pyx_XDECREF(__pyx_t_1);
14340 __Pyx_AddTraceback(
"View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14343 __Pyx_XDECREF((PyObject *)__pyx_v_result);
14344 __Pyx_XGIVEREF(__pyx_r);
14345 __Pyx_RefNannyFinishContext();
14358 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self);
14359 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
14360 PyObject *__pyx_r = 0;
14361 __Pyx_RefNannyDeclarations
14362 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
14363 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14366 __Pyx_RefNannyFinishContext();
14370 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14371 PyObject *__pyx_r = NULL;
14372 __Pyx_RefNannyDeclarations
14373 __Pyx_RefNannySetupContext(
"__get__", 0);
14382 __Pyx_XDECREF(__pyx_r);
14383 __Pyx_INCREF(__pyx_v_self->obj);
14384 __pyx_r = __pyx_v_self->obj;
14397 __Pyx_XGIVEREF(__pyx_r);
14398 __Pyx_RefNannyFinishContext();
14411 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self);
14412 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
14413 PyObject *__pyx_r = 0;
14414 __Pyx_RefNannyDeclarations
14415 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
14416 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14419 __Pyx_RefNannyFinishContext();
14423 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14424 Py_ssize_t __pyx_v_length;
14425 PyObject *__pyx_r = NULL;
14426 __Pyx_RefNannyDeclarations
14427 PyObject *__pyx_t_1 = NULL;
14428 Py_ssize_t *__pyx_t_2;
14429 Py_ssize_t *__pyx_t_3;
14430 Py_ssize_t *__pyx_t_4;
14431 PyObject *__pyx_t_5 = NULL;
14432 __Pyx_RefNannySetupContext(
"__get__", 0);
14441 __Pyx_XDECREF(__pyx_r);
14442 __pyx_t_1 = PyList_New(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 564, __pyx_L1_error)
14443 __Pyx_GOTREF(__pyx_t_1);
14444 __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
14445 for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
14446 __pyx_t_2 = __pyx_t_4;
14447 __pyx_v_length = (__pyx_t_2[0]);
14448 __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
14449 __Pyx_GOTREF(__pyx_t_5);
14450 if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 564, __pyx_L1_error)
14451 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14453 __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1));
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
14454 __Pyx_GOTREF(__pyx_t_5);
14455 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14456 __pyx_r = __pyx_t_5;
14470 __Pyx_XDECREF(__pyx_t_1);
14471 __Pyx_XDECREF(__pyx_t_5);
14472 __Pyx_AddTraceback(
"View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14475 __Pyx_XGIVEREF(__pyx_r);
14476 __Pyx_RefNannyFinishContext();
14489 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self);
14490 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
14491 PyObject *__pyx_r = 0;
14492 __Pyx_RefNannyDeclarations
14493 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
14494 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14497 __Pyx_RefNannyFinishContext();
14501 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14502 Py_ssize_t __pyx_v_stride;
14503 PyObject *__pyx_r = NULL;
14504 __Pyx_RefNannyDeclarations
14506 PyObject *__pyx_t_2 = NULL;
14507 Py_ssize_t *__pyx_t_3;
14508 Py_ssize_t *__pyx_t_4;
14509 Py_ssize_t *__pyx_t_5;
14510 PyObject *__pyx_t_6 = NULL;
14511 __Pyx_RefNannySetupContext(
"__get__", 0);
14520 __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
14521 if (unlikely(__pyx_t_1)) {
14530 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 570, __pyx_L1_error)
14531 __Pyx_GOTREF(__pyx_t_2);
14532 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
14533 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14534 __PYX_ERR(1, 570, __pyx_L1_error)
14552 __Pyx_XDECREF(__pyx_r);
14553 __pyx_t_2 = PyList_New(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error)
14554 __Pyx_GOTREF(__pyx_t_2);
14555 __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
14556 for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
14557 __pyx_t_3 = __pyx_t_5;
14558 __pyx_v_stride = (__pyx_t_3[0]);
14559 __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
14560 __Pyx_GOTREF(__pyx_t_6);
14561 if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 572, __pyx_L1_error)
14562 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14564 __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
14565 __Pyx_GOTREF(__pyx_t_6);
14566 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14567 __pyx_r = __pyx_t_6;
14581 __Pyx_XDECREF(__pyx_t_2);
14582 __Pyx_XDECREF(__pyx_t_6);
14583 __Pyx_AddTraceback(
"View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14586 __Pyx_XGIVEREF(__pyx_r);
14587 __Pyx_RefNannyFinishContext();
14600 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self);
14601 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
14602 PyObject *__pyx_r = 0;
14603 __Pyx_RefNannyDeclarations
14604 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
14605 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14608 __Pyx_RefNannyFinishContext();
14612 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14613 Py_ssize_t __pyx_v_suboffset;
14614 PyObject *__pyx_r = NULL;
14615 __Pyx_RefNannyDeclarations
14617 PyObject *__pyx_t_2 = NULL;
14618 PyObject *__pyx_t_3 = NULL;
14619 Py_ssize_t *__pyx_t_4;
14620 Py_ssize_t *__pyx_t_5;
14621 Py_ssize_t *__pyx_t_6;
14622 __Pyx_RefNannySetupContext(
"__get__", 0);
14631 __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
14641 __Pyx_XDECREF(__pyx_r);
14642 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error)
14643 __Pyx_GOTREF(__pyx_t_2);
14644 __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__23, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __pyx_L1_error)
14645 __Pyx_GOTREF(__pyx_t_3);
14646 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14647 __pyx_r = __pyx_t_3;
14667 __Pyx_XDECREF(__pyx_r);
14668 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 579, __pyx_L1_error)
14669 __Pyx_GOTREF(__pyx_t_3);
14670 __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
14671 for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
14672 __pyx_t_4 = __pyx_t_6;
14673 __pyx_v_suboffset = (__pyx_t_4[0]);
14674 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
14675 __Pyx_GOTREF(__pyx_t_2);
14676 if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 579, __pyx_L1_error)
14677 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14679 __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
14680 __Pyx_GOTREF(__pyx_t_2);
14681 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14682 __pyx_r = __pyx_t_2;
14696 __Pyx_XDECREF(__pyx_t_2);
14697 __Pyx_XDECREF(__pyx_t_3);
14698 __Pyx_AddTraceback(
"View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14701 __Pyx_XGIVEREF(__pyx_r);
14702 __Pyx_RefNannyFinishContext();
14715 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self);
14716 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
14717 PyObject *__pyx_r = 0;
14718 __Pyx_RefNannyDeclarations
14719 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
14720 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14723 __Pyx_RefNannyFinishContext();
14727 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14728 PyObject *__pyx_r = NULL;
14729 __Pyx_RefNannyDeclarations
14730 PyObject *__pyx_t_1 = NULL;
14731 __Pyx_RefNannySetupContext(
"__get__", 0);
14740 __Pyx_XDECREF(__pyx_r);
14741 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 583, __pyx_L1_error)
14742 __Pyx_GOTREF(__pyx_t_1);
14743 __pyx_r = __pyx_t_1;
14757 __Pyx_XDECREF(__pyx_t_1);
14758 __Pyx_AddTraceback(
"View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14761 __Pyx_XGIVEREF(__pyx_r);
14762 __Pyx_RefNannyFinishContext();
14775 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self);
14776 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
14777 PyObject *__pyx_r = 0;
14778 __Pyx_RefNannyDeclarations
14779 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
14780 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14783 __Pyx_RefNannyFinishContext();
14787 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14788 PyObject *__pyx_r = NULL;
14789 __Pyx_RefNannyDeclarations
14790 PyObject *__pyx_t_1 = NULL;
14791 __Pyx_RefNannySetupContext(
"__get__", 0);
14800 __Pyx_XDECREF(__pyx_r);
14801 __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 587, __pyx_L1_error)
14802 __Pyx_GOTREF(__pyx_t_1);
14803 __pyx_r = __pyx_t_1;
14817 __Pyx_XDECREF(__pyx_t_1);
14818 __Pyx_AddTraceback(
"View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14821 __Pyx_XGIVEREF(__pyx_r);
14822 __Pyx_RefNannyFinishContext();
14835 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self);
14836 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
14837 PyObject *__pyx_r = 0;
14838 __Pyx_RefNannyDeclarations
14839 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
14840 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14843 __Pyx_RefNannyFinishContext();
14847 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14848 PyObject *__pyx_r = NULL;
14849 __Pyx_RefNannyDeclarations
14850 PyObject *__pyx_t_1 = NULL;
14851 PyObject *__pyx_t_2 = NULL;
14852 PyObject *__pyx_t_3 = NULL;
14853 __Pyx_RefNannySetupContext(
"__get__", 0);
14862 __Pyx_XDECREF(__pyx_r);
14863 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 591, __pyx_L1_error)
14864 __Pyx_GOTREF(__pyx_t_1);
14865 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 591, __pyx_L1_error)
14866 __Pyx_GOTREF(__pyx_t_2);
14867 __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 591, __pyx_L1_error)
14868 __Pyx_GOTREF(__pyx_t_3);
14869 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14870 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14871 __pyx_r = __pyx_t_3;
14885 __Pyx_XDECREF(__pyx_t_1);
14886 __Pyx_XDECREF(__pyx_t_2);
14887 __Pyx_XDECREF(__pyx_t_3);
14888 __Pyx_AddTraceback(
"View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14891 __Pyx_XGIVEREF(__pyx_r);
14892 __Pyx_RefNannyFinishContext();
14905 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self);
14906 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
14907 PyObject *__pyx_r = 0;
14908 __Pyx_RefNannyDeclarations
14909 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
14910 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14913 __Pyx_RefNannyFinishContext();
14917 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14918 PyObject *__pyx_v_result = NULL;
14919 PyObject *__pyx_v_length = NULL;
14920 PyObject *__pyx_r = NULL;
14921 __Pyx_RefNannyDeclarations
14924 Py_ssize_t *__pyx_t_3;
14925 Py_ssize_t *__pyx_t_4;
14926 Py_ssize_t *__pyx_t_5;
14927 PyObject *__pyx_t_6 = NULL;
14928 __Pyx_RefNannySetupContext(
"__get__", 0);
14937 __pyx_t_1 = (__pyx_v_self->_size == Py_None);
14938 __pyx_t_2 = (__pyx_t_1 != 0);
14948 __Pyx_INCREF(__pyx_int_1);
14949 __pyx_v_result = __pyx_int_1;
14958 __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
14959 for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
14960 __pyx_t_3 = __pyx_t_5;
14961 __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0]));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 598, __pyx_L1_error)
14962 __Pyx_GOTREF(__pyx_t_6);
14963 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
14973 __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 599, __pyx_L1_error)
14974 __Pyx_GOTREF(__pyx_t_6);
14975 __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
14986 __Pyx_INCREF(__pyx_v_result);
14987 __Pyx_GIVEREF(__pyx_v_result);
14988 __Pyx_GOTREF(__pyx_v_self->_size);
14989 __Pyx_DECREF(__pyx_v_self->_size);
14990 __pyx_v_self->_size = __pyx_v_result;
15008 __Pyx_XDECREF(__pyx_r);
15009 __Pyx_INCREF(__pyx_v_self->_size);
15010 __pyx_r = __pyx_v_self->_size;
15023 __Pyx_XDECREF(__pyx_t_6);
15024 __Pyx_AddTraceback(
"View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15027 __Pyx_XDECREF(__pyx_v_result);
15028 __Pyx_XDECREF(__pyx_v_length);
15029 __Pyx_XGIVEREF(__pyx_r);
15030 __Pyx_RefNannyFinishContext();
15043 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self);
15044 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
15045 Py_ssize_t __pyx_r;
15046 __Pyx_RefNannyDeclarations
15047 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
15048 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
15051 __Pyx_RefNannyFinishContext();
15055 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self) {
15056 Py_ssize_t __pyx_r;
15057 __Pyx_RefNannyDeclarations
15059 __Pyx_RefNannySetupContext(
"__len__", 0);
15068 __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
15078 __pyx_r = (__pyx_v_self->view.shape[0]);
15110 __Pyx_RefNannyFinishContext();
15123 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self);
15124 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
15125 PyObject *__pyx_r = 0;
15126 __Pyx_RefNannyDeclarations
15127 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
15128 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
15131 __Pyx_RefNannyFinishContext();
15135 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self) {
15136 PyObject *__pyx_r = NULL;
15137 __Pyx_RefNannyDeclarations
15138 PyObject *__pyx_t_1 = NULL;
15139 PyObject *__pyx_t_2 = NULL;
15140 PyObject *__pyx_t_3 = NULL;
15141 __Pyx_RefNannySetupContext(
"__repr__", 0);
15150 __Pyx_XDECREF(__pyx_r);
15151 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
15152 __Pyx_GOTREF(__pyx_t_1);
15153 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
15154 __Pyx_GOTREF(__pyx_t_2);
15155 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15156 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
15157 __Pyx_GOTREF(__pyx_t_1);
15158 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15167 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 613, __pyx_L1_error)
15168 __Pyx_GOTREF(__pyx_t_2);
15177 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 612, __pyx_L1_error)
15178 __Pyx_GOTREF(__pyx_t_3);
15179 __Pyx_GIVEREF(__pyx_t_1);
15180 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
15181 __Pyx_GIVEREF(__pyx_t_2);
15182 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
15185 __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
15186 __Pyx_GOTREF(__pyx_t_2);
15187 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15188 __pyx_r = __pyx_t_2;
15202 __Pyx_XDECREF(__pyx_t_1);
15203 __Pyx_XDECREF(__pyx_t_2);
15204 __Pyx_XDECREF(__pyx_t_3);
15205 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15208 __Pyx_XGIVEREF(__pyx_r);
15209 __Pyx_RefNannyFinishContext();
15222 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self);
15223 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
15224 PyObject *__pyx_r = 0;
15225 __Pyx_RefNannyDeclarations
15226 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
15227 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
15230 __Pyx_RefNannyFinishContext();
15234 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self) {
15235 PyObject *__pyx_r = NULL;
15236 __Pyx_RefNannyDeclarations
15237 PyObject *__pyx_t_1 = NULL;
15238 PyObject *__pyx_t_2 = NULL;
15239 __Pyx_RefNannySetupContext(
"__str__", 0);
15248 __Pyx_XDECREF(__pyx_r);
15249 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
15250 __Pyx_GOTREF(__pyx_t_1);
15251 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
15252 __Pyx_GOTREF(__pyx_t_2);
15253 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15254 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
15255 __Pyx_GOTREF(__pyx_t_1);
15256 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15257 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
15258 __Pyx_GOTREF(__pyx_t_2);
15259 __Pyx_GIVEREF(__pyx_t_1);
15260 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
15262 __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
15263 __Pyx_GOTREF(__pyx_t_1);
15264 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15265 __pyx_r = __pyx_t_1;
15279 __Pyx_XDECREF(__pyx_t_1);
15280 __Pyx_XDECREF(__pyx_t_2);
15281 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15284 __Pyx_XGIVEREF(__pyx_r);
15285 __Pyx_RefNannyFinishContext();
15298 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
15299 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15300 PyObject *__pyx_r = 0;
15301 __Pyx_RefNannyDeclarations
15302 __Pyx_RefNannySetupContext(
"is_c_contig (wrapper)", 0);
15303 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
15306 __Pyx_RefNannyFinishContext();
15310 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
15311 __Pyx_memviewslice *__pyx_v_mslice;
15312 __Pyx_memviewslice __pyx_v_tmp;
15313 PyObject *__pyx_r = NULL;
15314 __Pyx_RefNannyDeclarations
15315 __Pyx_memviewslice *__pyx_t_1;
15316 PyObject *__pyx_t_2 = NULL;
15317 __Pyx_RefNannySetupContext(
"is_c_contig", 0);
15326 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 622, __pyx_L1_error)
15327 __pyx_v_mslice = __pyx_t_1;
15336 __Pyx_XDECREF(__pyx_r);
15337 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]),
'C', __pyx_v_self->view.ndim));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 623, __pyx_L1_error)
15338 __Pyx_GOTREF(__pyx_t_2);
15339 __pyx_r = __pyx_t_2;
15353 __Pyx_XDECREF(__pyx_t_2);
15354 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
15357 __Pyx_XGIVEREF(__pyx_r);
15358 __Pyx_RefNannyFinishContext();
15371 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
15372 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15373 PyObject *__pyx_r = 0;
15374 __Pyx_RefNannyDeclarations
15375 __Pyx_RefNannySetupContext(
"is_f_contig (wrapper)", 0);
15376 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
15379 __Pyx_RefNannyFinishContext();
15383 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
15384 __Pyx_memviewslice *__pyx_v_mslice;
15385 __Pyx_memviewslice __pyx_v_tmp;
15386 PyObject *__pyx_r = NULL;
15387 __Pyx_RefNannyDeclarations
15388 __Pyx_memviewslice *__pyx_t_1;
15389 PyObject *__pyx_t_2 = NULL;
15390 __Pyx_RefNannySetupContext(
"is_f_contig", 0);
15399 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 628, __pyx_L1_error)
15400 __pyx_v_mslice = __pyx_t_1;
15409 __Pyx_XDECREF(__pyx_r);
15410 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]),
'F', __pyx_v_self->view.ndim));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 629, __pyx_L1_error)
15411 __Pyx_GOTREF(__pyx_t_2);
15412 __pyx_r = __pyx_t_2;
15426 __Pyx_XDECREF(__pyx_t_2);
15427 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
15430 __Pyx_XGIVEREF(__pyx_r);
15431 __Pyx_RefNannyFinishContext();
15444 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
15445 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15446 PyObject *__pyx_r = 0;
15447 __Pyx_RefNannyDeclarations
15448 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
15449 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((
struct __pyx_memoryview_obj *)__pyx_v_self));
15452 __Pyx_RefNannyFinishContext();
15456 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self) {
15457 __Pyx_memviewslice __pyx_v_mslice;
15459 PyObject *__pyx_r = NULL;
15460 __Pyx_RefNannyDeclarations
15461 __Pyx_memviewslice __pyx_t_1;
15462 PyObject *__pyx_t_2 = NULL;
15463 __Pyx_RefNannySetupContext(
"copy", 0);
15472 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
15481 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
15490 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((
char *)
"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 636, __pyx_L1_error)
15491 __pyx_v_mslice = __pyx_t_1;
15500 __Pyx_XDECREF(__pyx_r);
15501 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 641, __pyx_L1_error)
15502 __Pyx_GOTREF(__pyx_t_2);
15503 __pyx_r = __pyx_t_2;
15517 __Pyx_XDECREF(__pyx_t_2);
15518 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
15521 __Pyx_XGIVEREF(__pyx_r);
15522 __Pyx_RefNannyFinishContext();
15535 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
15536 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15537 PyObject *__pyx_r = 0;
15538 __Pyx_RefNannyDeclarations
15539 __Pyx_RefNannySetupContext(
"copy_fortran (wrapper)", 0);
15540 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((
struct __pyx_memoryview_obj *)__pyx_v_self));
15543 __Pyx_RefNannyFinishContext();
15547 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self) {
15548 __Pyx_memviewslice __pyx_v_src;
15549 __Pyx_memviewslice __pyx_v_dst;
15551 PyObject *__pyx_r = NULL;
15552 __Pyx_RefNannyDeclarations
15553 __Pyx_memviewslice __pyx_t_1;
15554 PyObject *__pyx_t_2 = NULL;
15555 __Pyx_RefNannySetupContext(
"copy_fortran", 0);
15564 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
15573 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
15582 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((
char *)
"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 648, __pyx_L1_error)
15583 __pyx_v_dst = __pyx_t_1;
15592 __Pyx_XDECREF(__pyx_r);
15593 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 653, __pyx_L1_error)
15594 __Pyx_GOTREF(__pyx_t_2);
15595 __pyx_r = __pyx_t_2;
15609 __Pyx_XDECREF(__pyx_t_2);
15610 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
15613 __Pyx_XGIVEREF(__pyx_r);
15614 __Pyx_RefNannyFinishContext();
15625 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
15626 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15627 PyObject *__pyx_r = 0;
15628 __Pyx_RefNannyDeclarations
15629 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
15630 __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
15633 __Pyx_RefNannyFinishContext();
15637 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self) {
15638 PyObject *__pyx_r = NULL;
15639 __Pyx_RefNannyDeclarations
15640 PyObject *__pyx_t_1 = NULL;
15641 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
15649 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
15650 __Pyx_GOTREF(__pyx_t_1);
15651 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
15652 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15653 __PYX_ERR(1, 2, __pyx_L1_error)
15663 __Pyx_XDECREF(__pyx_t_1);
15664 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15666 __Pyx_XGIVEREF(__pyx_r);
15667 __Pyx_RefNannyFinishContext();
15679 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
15680 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
15681 PyObject *__pyx_r = 0;
15682 __Pyx_RefNannyDeclarations
15683 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
15684 __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
15687 __Pyx_RefNannyFinishContext();
15691 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
15692 PyObject *__pyx_r = NULL;
15693 __Pyx_RefNannyDeclarations
15694 PyObject *__pyx_t_1 = NULL;
15695 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
15702 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__25, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
15703 __Pyx_GOTREF(__pyx_t_1);
15704 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
15705 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15706 __PYX_ERR(1, 4, __pyx_L1_error)
15717 __Pyx_XDECREF(__pyx_t_1);
15718 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15720 __Pyx_XGIVEREF(__pyx_r);
15721 __Pyx_RefNannyFinishContext();
15733 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o,
int __pyx_v_flags,
int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
15734 struct __pyx_memoryview_obj *__pyx_v_result = 0;
15735 PyObject *__pyx_r = NULL;
15736 __Pyx_RefNannyDeclarations
15737 PyObject *__pyx_t_1 = NULL;
15738 PyObject *__pyx_t_2 = NULL;
15739 PyObject *__pyx_t_3 = NULL;
15740 __Pyx_RefNannySetupContext(
"memoryview_cwrapper", 0);
15749 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 658, __pyx_L1_error)
15750 __Pyx_GOTREF(__pyx_t_1);
15751 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
15752 __Pyx_GOTREF(__pyx_t_2);
15753 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __pyx_L1_error)
15754 __Pyx_GOTREF(__pyx_t_3);
15755 __Pyx_INCREF(__pyx_v_o);
15756 __Pyx_GIVEREF(__pyx_v_o);
15757 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
15758 __Pyx_GIVEREF(__pyx_t_1);
15759 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
15760 __Pyx_GIVEREF(__pyx_t_2);
15761 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
15764 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
15765 __Pyx_GOTREF(__pyx_t_2);
15766 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15767 __pyx_v_result = ((
struct __pyx_memoryview_obj *)__pyx_t_2);
15777 __pyx_v_result->typeinfo = __pyx_v_typeinfo;
15786 __Pyx_XDECREF(__pyx_r);
15787 __Pyx_INCREF(((PyObject *)__pyx_v_result));
15788 __pyx_r = ((PyObject *)__pyx_v_result);
15801 __Pyx_XDECREF(__pyx_t_1);
15802 __Pyx_XDECREF(__pyx_t_2);
15803 __Pyx_XDECREF(__pyx_t_3);
15804 __Pyx_AddTraceback(
"View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
15807 __Pyx_XDECREF((PyObject *)__pyx_v_result);
15808 __Pyx_XGIVEREF(__pyx_r);
15809 __Pyx_RefNannyFinishContext();
15821 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *__pyx_v_o) {
15823 __Pyx_RefNannyDeclarations
15825 __Pyx_RefNannySetupContext(
"memoryview_check", 0);
15834 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
15835 __pyx_r = __pyx_t_1;
15848 __Pyx_RefNannyFinishContext();
15860 static PyObject *_unellipsify(PyObject *__pyx_v_index,
int __pyx_v_ndim) {
15861 PyObject *__pyx_v_tup = NULL;
15862 PyObject *__pyx_v_result = NULL;
15863 int __pyx_v_have_slices;
15864 int __pyx_v_seen_ellipsis;
15865 CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
15866 PyObject *__pyx_v_item = NULL;
15867 Py_ssize_t __pyx_v_nslices;
15868 PyObject *__pyx_r = NULL;
15869 __Pyx_RefNannyDeclarations
15872 PyObject *__pyx_t_3 = NULL;
15873 PyObject *__pyx_t_4 = NULL;
15874 Py_ssize_t __pyx_t_5;
15875 PyObject *(*__pyx_t_6)(PyObject *);
15876 PyObject *__pyx_t_7 = NULL;
15877 Py_ssize_t __pyx_t_8;
15880 PyObject *__pyx_t_11 = NULL;
15881 __Pyx_RefNannySetupContext(
"_unellipsify", 0);
15890 __pyx_t_1 = PyTuple_Check(__pyx_v_index);
15891 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
15901 __pyx_t_3 = PyTuple_New(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 672, __pyx_L1_error)
15902 __Pyx_GOTREF(__pyx_t_3);
15903 __Pyx_INCREF(__pyx_v_index);
15904 __Pyx_GIVEREF(__pyx_v_index);
15905 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
15906 __pyx_v_tup = __pyx_t_3;
15927 __Pyx_INCREF(__pyx_v_index);
15928 __pyx_v_tup = __pyx_v_index;
15939 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 676, __pyx_L1_error)
15940 __Pyx_GOTREF(__pyx_t_3);
15941 __pyx_v_result = ((PyObject*)__pyx_t_3);
15951 __pyx_v_have_slices = 0;
15960 __pyx_v_seen_ellipsis = 0;
15969 __Pyx_INCREF(__pyx_int_0);
15970 __pyx_t_3 = __pyx_int_0;
15971 if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
15972 __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
15975 __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 679, __pyx_L1_error)
15976 __Pyx_GOTREF(__pyx_t_4);
15977 __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 679, __pyx_L1_error)
15980 if (likely(!__pyx_t_6)) {
15981 if (likely(PyList_CheckExact(__pyx_t_4))) {
15982 if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4))
break;
15983 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 15984 __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++;
if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
15986 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
15987 __Pyx_GOTREF(__pyx_t_7);
15990 if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4))
break;
15991 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 15992 __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++;
if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
15994 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
15995 __Pyx_GOTREF(__pyx_t_7);
15999 __pyx_t_7 = __pyx_t_6(__pyx_t_4);
16000 if (unlikely(!__pyx_t_7)) {
16001 PyObject* exc_type = PyErr_Occurred();
16003 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
16004 else __PYX_ERR(1, 679, __pyx_L1_error)
16008 __Pyx_GOTREF(__pyx_t_7);
16010 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
16012 __Pyx_INCREF(__pyx_t_3);
16013 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
16014 __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
16015 __Pyx_GOTREF(__pyx_t_7);
16016 __Pyx_DECREF(__pyx_t_3);
16017 __pyx_t_3 = __pyx_t_7;
16027 __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
16028 __pyx_t_1 = (__pyx_t_2 != 0);
16038 __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
16048 __pyx_t_8 = PyObject_Length(__pyx_v_tup);
if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
16049 __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1)));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 682, __pyx_L1_error)
16050 __Pyx_GOTREF(__pyx_t_7);
16051 { Py_ssize_t __pyx_temp;
16052 for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
16053 __Pyx_INCREF(__pyx_slice__26);
16054 __Pyx_GIVEREF(__pyx_slice__26);
16055 PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__26);
16058 __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
16059 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16068 __pyx_v_seen_ellipsis = 1;
16088 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__26);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 685, __pyx_L1_error)
16099 __pyx_v_have_slices = 1;
16119 __pyx_t_2 = PySlice_Check(__pyx_v_item);
16120 __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
16123 __pyx_t_1 = __pyx_t_10;
16124 goto __pyx_L9_bool_binop_done;
16126 __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
16127 __pyx_t_1 = __pyx_t_10;
16128 __pyx_L9_bool_binop_done:;
16129 if (unlikely(__pyx_t_1)) {
16138 __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item)));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 689, __pyx_L1_error)
16139 __Pyx_GOTREF(__pyx_t_7);
16140 __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7);
if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 689, __pyx_L1_error)
16141 __Pyx_GOTREF(__pyx_t_11);
16142 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16143 __Pyx_Raise(__pyx_t_11, 0, 0, 0);
16144 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
16145 __PYX_ERR(1, 689, __pyx_L1_error)
16163 __pyx_t_10 = (__pyx_v_have_slices != 0);
16166 __pyx_t_1 = __pyx_t_10;
16167 goto __pyx_L11_bool_binop_done;
16169 __pyx_t_10 = PySlice_Check(__pyx_v_item);
16170 __pyx_t_2 = (__pyx_t_10 != 0);
16171 __pyx_t_1 = __pyx_t_2;
16172 __pyx_L11_bool_binop_done:;
16173 __pyx_v_have_slices = __pyx_t_1;
16182 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 692, __pyx_L1_error)
16194 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16195 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16204 __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result);
if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 694, __pyx_L1_error)
16205 __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
16214 __pyx_t_1 = (__pyx_v_nslices != 0);
16224 __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 696, __pyx_L1_error)
16225 __Pyx_GOTREF(__pyx_t_3);
16226 { Py_ssize_t __pyx_temp;
16227 for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
16228 __Pyx_INCREF(__pyx_slice__26);
16229 __Pyx_GIVEREF(__pyx_slice__26);
16230 PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__26);
16233 __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 696, __pyx_L1_error)
16234 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16252 __Pyx_XDECREF(__pyx_r);
16253 if (!__pyx_v_have_slices) {
16255 __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
16256 __Pyx_GOTREF(__pyx_t_4);
16257 __pyx_t_3 = __pyx_t_4;
16259 goto __pyx_L14_bool_binop_done;
16261 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
16262 __Pyx_GOTREF(__pyx_t_4);
16263 __pyx_t_3 = __pyx_t_4;
16265 __pyx_L14_bool_binop_done:;
16266 __pyx_t_4 = PyList_AsTuple(__pyx_v_result);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
16267 __Pyx_GOTREF(__pyx_t_4);
16268 __pyx_t_11 = PyTuple_New(2);
if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 698, __pyx_L1_error)
16269 __Pyx_GOTREF(__pyx_t_11);
16270 __Pyx_GIVEREF(__pyx_t_3);
16271 PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
16272 __Pyx_GIVEREF(__pyx_t_4);
16273 PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
16276 __pyx_r = ((PyObject*)__pyx_t_11);
16290 __Pyx_XDECREF(__pyx_t_3);
16291 __Pyx_XDECREF(__pyx_t_4);
16292 __Pyx_XDECREF(__pyx_t_7);
16293 __Pyx_XDECREF(__pyx_t_11);
16294 __Pyx_AddTraceback(
"View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
16297 __Pyx_XDECREF(__pyx_v_tup);
16298 __Pyx_XDECREF(__pyx_v_result);
16299 __Pyx_XDECREF(__pyx_v_idx);
16300 __Pyx_XDECREF(__pyx_v_item);
16301 __Pyx_XGIVEREF(__pyx_r);
16302 __Pyx_RefNannyFinishContext();
16314 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets,
int __pyx_v_ndim) {
16315 Py_ssize_t __pyx_v_suboffset;
16316 PyObject *__pyx_r = NULL;
16317 __Pyx_RefNannyDeclarations
16318 Py_ssize_t *__pyx_t_1;
16319 Py_ssize_t *__pyx_t_2;
16320 Py_ssize_t *__pyx_t_3;
16322 PyObject *__pyx_t_5 = NULL;
16323 __Pyx_RefNannySetupContext(
"assert_direct_dimensions", 0);
16332 __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
16333 for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
16334 __pyx_t_1 = __pyx_t_3;
16335 __pyx_v_suboffset = (__pyx_t_1[0]);
16344 __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
16345 if (unlikely(__pyx_t_4)) {
16354 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 703, __pyx_L1_error)
16355 __Pyx_GOTREF(__pyx_t_5);
16356 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
16357 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16358 __PYX_ERR(1, 703, __pyx_L1_error)
16379 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16382 __Pyx_XDECREF(__pyx_t_5);
16383 __Pyx_AddTraceback(
"View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
16386 __Pyx_XGIVEREF(__pyx_r);
16387 __Pyx_RefNannyFinishContext();
16399 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
16400 int __pyx_v_new_ndim;
16401 int __pyx_v_suboffset_dim;
16403 __Pyx_memviewslice __pyx_v_src;
16404 __Pyx_memviewslice __pyx_v_dst;
16405 __Pyx_memviewslice *__pyx_v_p_src;
16406 struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
16407 __Pyx_memviewslice *__pyx_v_p_dst;
16408 int *__pyx_v_p_suboffset_dim;
16409 Py_ssize_t __pyx_v_start;
16410 Py_ssize_t __pyx_v_stop;
16411 Py_ssize_t __pyx_v_step;
16412 int __pyx_v_have_start;
16413 int __pyx_v_have_stop;
16414 int __pyx_v_have_step;
16415 PyObject *__pyx_v_index = NULL;
16416 struct __pyx_memoryview_obj *__pyx_r = NULL;
16417 __Pyx_RefNannyDeclarations
16420 PyObject *__pyx_t_3 = NULL;
16421 struct __pyx_memoryview_obj *__pyx_t_4;
16424 Py_ssize_t __pyx_t_7;
16425 PyObject *(*__pyx_t_8)(PyObject *);
16426 PyObject *__pyx_t_9 = NULL;
16427 Py_ssize_t __pyx_t_10;
16429 Py_ssize_t __pyx_t_12;
16430 __Pyx_RefNannySetupContext(
"memview_slice", 0);
16439 __pyx_v_new_ndim = 0;
16440 __pyx_v_suboffset_dim = -1;
16449 (void)(memset((&__pyx_v_dst), 0, (
sizeof(__pyx_v_dst))));
16458 #ifndef CYTHON_WITHOUT_ASSERTIONS 16459 if (unlikely(!Py_OptimizeFlag)) {
16460 if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
16461 PyErr_SetNone(PyExc_AssertionError);
16462 __PYX_ERR(1, 722, __pyx_L1_error)
16474 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
16475 __pyx_t_2 = (__pyx_t_1 != 0);
16485 if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 725, __pyx_L1_error)
16486 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
16487 __Pyx_INCREF(__pyx_t_3);
16488 __pyx_v_memviewsliceobj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
16498 __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
16518 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
16527 __pyx_v_p_src = (&__pyx_v_src);
16538 __pyx_t_4 = __pyx_v_p_src->memview;
16539 __pyx_v_dst.memview = __pyx_t_4;
16548 __pyx_t_5 = __pyx_v_p_src->data;
16549 __pyx_v_dst.data = __pyx_t_5;
16558 __pyx_v_p_dst = (&__pyx_v_dst);
16567 __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
16577 if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
16578 __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
16581 __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 746, __pyx_L1_error)
16582 __Pyx_GOTREF(__pyx_t_3);
16583 __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 746, __pyx_L1_error)
16586 if (likely(!__pyx_t_8)) {
16587 if (likely(PyList_CheckExact(__pyx_t_3))) {
16588 if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3))
break;
16589 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 16590 __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
16592 __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
16593 __Pyx_GOTREF(__pyx_t_9);
16596 if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
16597 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 16598 __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
16600 __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
16601 __Pyx_GOTREF(__pyx_t_9);
16605 __pyx_t_9 = __pyx_t_8(__pyx_t_3);
16606 if (unlikely(!__pyx_t_9)) {
16607 PyObject* exc_type = PyErr_Occurred();
16609 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
16610 else __PYX_ERR(1, 746, __pyx_L1_error)
16614 __Pyx_GOTREF(__pyx_t_9);
16616 __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
16618 __pyx_v_dim = __pyx_t_6;
16619 __pyx_t_6 = (__pyx_t_6 + 1);
16628 __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
16638 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index);
if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 751, __pyx_L1_error)
16647 __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(1, 748, __pyx_L1_error)
16666 __pyx_t_2 = (__pyx_v_index == Py_None);
16667 __pyx_t_1 = (__pyx_t_2 != 0);
16677 (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
16686 (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
16695 (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1
L;
16704 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
16724 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 760, __pyx_L1_error)
16725 __Pyx_GOTREF(__pyx_t_9);
16726 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 760, __pyx_L1_error)
16728 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16730 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 760, __pyx_L1_error)
16731 __pyx_t_10 = __pyx_t_12;
16732 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16733 goto __pyx_L7_bool_binop_done;
16736 __pyx_L7_bool_binop_done:;
16737 __pyx_v_start = __pyx_t_10;
16746 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 761, __pyx_L1_error)
16747 __Pyx_GOTREF(__pyx_t_9);
16748 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 761, __pyx_L1_error)
16750 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16752 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 761, __pyx_L1_error)
16753 __pyx_t_10 = __pyx_t_12;
16754 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16755 goto __pyx_L9_bool_binop_done;
16758 __pyx_L9_bool_binop_done:;
16759 __pyx_v_stop = __pyx_t_10;
16768 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 762, __pyx_L1_error)
16769 __Pyx_GOTREF(__pyx_t_9);
16770 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 762, __pyx_L1_error)
16772 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16774 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
16775 __pyx_t_10 = __pyx_t_12;
16776 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16777 goto __pyx_L11_bool_binop_done;
16780 __pyx_L11_bool_binop_done:;
16781 __pyx_v_step = __pyx_t_10;
16790 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 764, __pyx_L1_error)
16791 __Pyx_GOTREF(__pyx_t_9);
16792 __pyx_t_1 = (__pyx_t_9 != Py_None);
16793 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16794 __pyx_v_have_start = __pyx_t_1;
16803 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 765, __pyx_L1_error)
16804 __Pyx_GOTREF(__pyx_t_9);
16805 __pyx_t_1 = (__pyx_t_9 != Py_None);
16806 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16807 __pyx_v_have_stop = __pyx_t_1;
16816 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 766, __pyx_L1_error)
16817 __Pyx_GOTREF(__pyx_t_9);
16818 __pyx_t_1 = (__pyx_t_9 != Py_None);
16819 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16820 __pyx_v_have_step = __pyx_t_1;
16829 __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(1, 768, __pyx_L1_error)
16838 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
16850 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16859 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
16860 __pyx_t_2 = (__pyx_t_1 != 0);
16870 __Pyx_XDECREF(((PyObject *)__pyx_r));
16879 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 778, __pyx_L1_error) }
16888 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 779, __pyx_L1_error) }
16897 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 777, __pyx_L1_error)
16898 __Pyx_GOTREF(__pyx_t_3);
16899 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 777, __pyx_L1_error)
16900 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
16921 __Pyx_XDECREF(((PyObject *)__pyx_r));
16930 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 782, __pyx_L1_error)
16931 __Pyx_GOTREF(__pyx_t_3);
16940 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 782, __pyx_L1_error)
16941 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
16956 __Pyx_XDECREF(__pyx_t_3);
16957 __Pyx_XDECREF(__pyx_t_9);
16958 __Pyx_AddTraceback(
"View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16961 __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
16962 __Pyx_XDECREF(__pyx_v_index);
16963 __Pyx_XGIVEREF((PyObject *)__pyx_r);
16964 __Pyx_RefNannyFinishContext();
16976 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset,
int __pyx_v_dim,
int __pyx_v_new_ndim,
int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step,
int __pyx_v_have_start,
int __pyx_v_have_stop,
int __pyx_v_have_step,
int __pyx_v_is_slice) {
16977 Py_ssize_t __pyx_v_new_shape;
16978 int __pyx_v_negative_step;
16991 __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
17001 __pyx_t_1 = ((__pyx_v_start < 0) != 0);
17011 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
17029 __pyx_t_1 = (0 <= __pyx_v_start);
17031 __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
17033 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
17043 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((
char *)
"Index out of bounds (axis %d)"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 832, __pyx_L1_error)
17072 __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
17075 __pyx_t_2 = __pyx_t_1;
17076 goto __pyx_L6_bool_binop_done;
17078 __pyx_t_1 = ((__pyx_v_step < 0) != 0);
17079 __pyx_t_2 = __pyx_t_1;
17080 __pyx_L6_bool_binop_done:;
17081 __pyx_v_negative_step = __pyx_t_2;
17090 __pyx_t_1 = (__pyx_v_have_step != 0);
17093 __pyx_t_2 = __pyx_t_1;
17094 goto __pyx_L9_bool_binop_done;
17096 __pyx_t_1 = ((__pyx_v_step == 0) != 0);
17097 __pyx_t_2 = __pyx_t_1;
17098 __pyx_L9_bool_binop_done:;
17108 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((
char *)
"Step may not be zero (axis %d)"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 838, __pyx_L1_error)
17126 __pyx_t_2 = (__pyx_v_have_start != 0);
17136 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
17146 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
17155 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
17193 __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
17203 __pyx_t_2 = (__pyx_v_negative_step != 0);
17213 __pyx_v_start = (__pyx_v_shape - 1);
17233 __pyx_v_start = __pyx_v_shape;
17265 __pyx_t_2 = (__pyx_v_negative_step != 0);
17275 __pyx_v_start = (__pyx_v_shape - 1);
17308 __pyx_t_2 = (__pyx_v_have_stop != 0);
17318 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
17328 __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
17337 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
17375 __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
17385 __pyx_v_stop = __pyx_v_shape;
17415 __pyx_t_2 = (__pyx_v_negative_step != 0);
17425 __pyx_v_stop = -1
L;
17445 __pyx_v_stop = __pyx_v_shape;
17458 __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
17486 __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
17495 __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
17505 __pyx_v_new_shape = (__pyx_v_new_shape + 1);
17523 __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
17533 __pyx_v_new_shape = 0;
17551 (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
17560 (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
17569 (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
17580 __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
17590 __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
17610 __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
17611 (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
17622 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
17632 __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
17642 __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
17652 __pyx_v_dst->data = ((((
char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
17680 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((
char *)
"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 899, __pyx_L1_error)
17702 (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
17737 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17739 __Pyx_AddTraceback(
"View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17741 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17757 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view,
char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
17758 Py_ssize_t __pyx_v_shape;
17759 Py_ssize_t __pyx_v_stride;
17760 Py_ssize_t __pyx_v_suboffset;
17761 Py_ssize_t __pyx_v_itemsize;
17762 char *__pyx_v_resultp;
17764 __Pyx_RefNannyDeclarations
17765 Py_ssize_t __pyx_t_1;
17767 PyObject *__pyx_t_3 = NULL;
17768 PyObject *__pyx_t_4 = NULL;
17769 __Pyx_RefNannySetupContext(
"pybuffer_index", 0);
17778 __pyx_v_suboffset = -1
L;
17787 __pyx_t_1 = __pyx_v_view->itemsize;
17788 __pyx_v_itemsize = __pyx_t_1;
17797 __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
17807 if (unlikely(__pyx_v_itemsize == 0)) {
17808 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
17809 __PYX_ERR(1, 917, __pyx_L1_error)
17811 else if (
sizeof(Py_ssize_t) ==
sizeof(
long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
17812 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
17813 __PYX_ERR(1, 917, __pyx_L1_error)
17815 __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
17824 __pyx_v_stride = __pyx_v_itemsize;
17844 __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
17853 __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
17862 __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
17872 __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
17892 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
17902 __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
17911 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
17912 if (unlikely(__pyx_t_2)) {
17921 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
17922 __Pyx_GOTREF(__pyx_t_3);
17923 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 928, __pyx_L1_error)
17924 __Pyx_GOTREF(__pyx_t_4);
17925 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17926 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
17927 __Pyx_GOTREF(__pyx_t_3);
17928 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17929 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17930 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17931 __PYX_ERR(1, 928, __pyx_L1_error)
17958 __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
17959 if (unlikely(__pyx_t_2)) {
17968 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
17969 __Pyx_GOTREF(__pyx_t_3);
17970 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 931, __pyx_L1_error)
17971 __Pyx_GOTREF(__pyx_t_4);
17972 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17973 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
17974 __Pyx_GOTREF(__pyx_t_3);
17975 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17976 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17977 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17978 __PYX_ERR(1, 931, __pyx_L1_error)
17996 __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
18005 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
18015 __pyx_v_resultp = ((((
char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
18033 __pyx_r = __pyx_v_resultp;
18046 __Pyx_XDECREF(__pyx_t_3);
18047 __Pyx_XDECREF(__pyx_t_4);
18048 __Pyx_AddTraceback(
"View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
18051 __Pyx_RefNannyFinishContext();
18063 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
18065 Py_ssize_t *__pyx_v_shape;
18066 Py_ssize_t *__pyx_v_strides;
18071 Py_ssize_t *__pyx_t_2;
18074 Py_ssize_t __pyx_t_5;
18075 Py_ssize_t __pyx_t_6;
18087 __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
18088 __pyx_v_ndim = __pyx_t_1;
18097 __pyx_t_2 = __pyx_v_memslice->shape;
18098 __pyx_v_shape = __pyx_t_2;
18107 __pyx_t_2 = __pyx_v_memslice->strides;
18108 __pyx_v_strides = __pyx_t_2;
18117 __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
18118 __pyx_t_4 = __pyx_t_3;
18119 for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
18120 __pyx_v_i = __pyx_t_1;
18129 __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
18138 __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
18139 __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
18140 (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
18141 (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
18150 __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
18151 __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
18152 (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
18153 (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
18162 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
18165 __pyx_t_7 = __pyx_t_8;
18166 goto __pyx_L6_bool_binop_done;
18168 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
18169 __pyx_t_7 = __pyx_t_8;
18170 __pyx_L6_bool_binop_done:;
18180 __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((
char *)
"Cannot transpose memoryview with indirect dimensions"));
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 957, __pyx_L1_error)
18214 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18216 __Pyx_AddTraceback(
"View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18218 __Pyx_PyGILState_Release(__pyx_gilstate_save);
18235 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self);
18236 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
18237 __Pyx_RefNannyDeclarations
18238 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
18239 __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
18242 __Pyx_RefNannyFinishContext();
18245 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
18246 __Pyx_RefNannyDeclarations
18247 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
18256 __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
18267 __Pyx_RefNannyFinishContext();
18278 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp) {
18279 PyObject *__pyx_r = NULL;
18280 __Pyx_RefNannyDeclarations
18282 PyObject *__pyx_t_2 = NULL;
18283 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
18292 __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
18302 __Pyx_XDECREF(__pyx_r);
18303 __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 981, __pyx_L1_error)
18304 __Pyx_GOTREF(__pyx_t_2);
18305 __pyx_r = __pyx_t_2;
18326 __Pyx_XDECREF(__pyx_r);
18327 __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 983, __pyx_L1_error)
18328 __Pyx_GOTREF(__pyx_t_2);
18329 __pyx_r = __pyx_t_2;
18344 __Pyx_XDECREF(__pyx_t_2);
18345 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
18348 __Pyx_XGIVEREF(__pyx_r);
18349 __Pyx_RefNannyFinishContext();
18361 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
18362 PyObject *__pyx_r = NULL;
18363 __Pyx_RefNannyDeclarations
18366 PyObject *__pyx_t_3 = NULL;
18367 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
18376 __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
18386 __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value);
if (unlikely(__pyx_t_2 == ((
int)0))) __PYX_ERR(1, 987, __pyx_L1_error)
18406 __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 989, __pyx_L1_error)
18407 __Pyx_GOTREF(__pyx_t_3);
18408 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18421 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18424 __Pyx_XDECREF(__pyx_t_3);
18425 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
18428 __Pyx_XGIVEREF(__pyx_r);
18429 __Pyx_RefNannyFinishContext();
18442 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self);
18443 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
18444 PyObject *__pyx_r = 0;
18445 __Pyx_RefNannyDeclarations
18446 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
18447 __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
18450 __Pyx_RefNannyFinishContext();
18454 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
18455 PyObject *__pyx_r = NULL;
18456 __Pyx_RefNannyDeclarations
18457 __Pyx_RefNannySetupContext(
"__get__", 0);
18466 __Pyx_XDECREF(__pyx_r);
18467 __Pyx_INCREF(__pyx_v_self->from_object);
18468 __pyx_r = __pyx_v_self->from_object;
18481 __Pyx_XGIVEREF(__pyx_r);
18482 __Pyx_RefNannyFinishContext();
18493 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
18494 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
18495 PyObject *__pyx_r = 0;
18496 __Pyx_RefNannyDeclarations
18497 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
18498 __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
18501 __Pyx_RefNannyFinishContext();
18505 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
18506 PyObject *__pyx_r = NULL;
18507 __Pyx_RefNannyDeclarations
18508 PyObject *__pyx_t_1 = NULL;
18509 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
18517 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__28, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
18518 __Pyx_GOTREF(__pyx_t_1);
18519 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
18520 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18521 __PYX_ERR(1, 2, __pyx_L1_error)
18531 __Pyx_XDECREF(__pyx_t_1);
18532 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18534 __Pyx_XGIVEREF(__pyx_r);
18535 __Pyx_RefNannyFinishContext();
18547 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
18548 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
18549 PyObject *__pyx_r = 0;
18550 __Pyx_RefNannyDeclarations
18551 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
18552 __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
18555 __Pyx_RefNannyFinishContext();
18559 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
18560 PyObject *__pyx_r = NULL;
18561 __Pyx_RefNannyDeclarations
18562 PyObject *__pyx_t_1 = NULL;
18563 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
18570 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__29, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
18571 __Pyx_GOTREF(__pyx_t_1);
18572 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
18573 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18574 __PYX_ERR(1, 4, __pyx_L1_error)
18585 __Pyx_XDECREF(__pyx_t_1);
18586 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18588 __Pyx_XGIVEREF(__pyx_r);
18589 __Pyx_RefNannyFinishContext();
18601 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice,
int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(
char *),
int (*__pyx_v_to_dtype_func)(
char *, PyObject *),
int __pyx_v_dtype_is_object) {
18602 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
18603 Py_ssize_t __pyx_v_suboffset;
18604 PyObject *__pyx_v_length = NULL;
18605 PyObject *__pyx_r = NULL;
18606 __Pyx_RefNannyDeclarations
18608 PyObject *__pyx_t_2 = NULL;
18609 PyObject *__pyx_t_3 = NULL;
18610 __Pyx_TypeInfo *__pyx_t_4;
18611 Py_buffer __pyx_t_5;
18612 Py_ssize_t *__pyx_t_6;
18613 Py_ssize_t *__pyx_t_7;
18614 Py_ssize_t *__pyx_t_8;
18615 Py_ssize_t __pyx_t_9;
18616 __Pyx_RefNannySetupContext(
"memoryview_fromslice", 0);
18625 __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
18635 __Pyx_XDECREF(__pyx_r);
18636 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18655 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
18656 __Pyx_GOTREF(__pyx_t_2);
18657 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1013, __pyx_L1_error)
18658 __Pyx_GOTREF(__pyx_t_3);
18659 __Pyx_INCREF(Py_None);
18660 __Pyx_GIVEREF(Py_None);
18661 PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
18662 __Pyx_INCREF(__pyx_int_0);
18663 __Pyx_GIVEREF(__pyx_int_0);
18664 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
18665 __Pyx_GIVEREF(__pyx_t_2);
18666 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
18668 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
18669 __Pyx_GOTREF(__pyx_t_2);
18670 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18671 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_2);
18681 __pyx_v_result->from_slice = __pyx_v_memviewslice;
18690 __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
18699 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1018, __pyx_L1_error)
18700 __Pyx_GOTREF(__pyx_t_2);
18701 __Pyx_GIVEREF(__pyx_t_2);
18702 __Pyx_GOTREF(__pyx_v_result->from_object);
18703 __Pyx_DECREF(__pyx_v_result->from_object);
18704 __pyx_v_result->from_object = __pyx_t_2;
18714 __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
18715 __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
18724 __pyx_t_5 = __pyx_v_memviewslice.memview->view;
18725 __pyx_v_result->__pyx_base.view = __pyx_t_5;
18734 __pyx_v_result->__pyx_base.view.buf = ((
void *)__pyx_v_memviewslice.data);
18743 __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
18752 ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
18761 Py_INCREF(Py_None);
18770 __pyx_t_1 = ((((
struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
18780 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
18800 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
18811 __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
18820 __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
18829 __pyx_v_result->__pyx_base.view.suboffsets = NULL;
18838 __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
18839 for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
18840 __pyx_t_6 = __pyx_t_8;
18841 __pyx_v_suboffset = (__pyx_t_6[0]);
18850 __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
18860 __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
18869 goto __pyx_L6_break;
18889 __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
18890 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
18899 __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
18900 for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
18901 __pyx_t_6 = __pyx_t_8;
18902 __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1043, __pyx_L1_error)
18903 __Pyx_GOTREF(__pyx_t_2);
18904 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
18914 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1044, __pyx_L1_error)
18915 __Pyx_GOTREF(__pyx_t_2);
18916 __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1044, __pyx_L1_error)
18917 __Pyx_GOTREF(__pyx_t_3);
18918 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18919 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1044, __pyx_L1_error)
18920 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18921 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
18931 __pyx_v_result->to_object_func = __pyx_v_to_object_func;
18940 __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
18949 __Pyx_XDECREF(__pyx_r);
18950 __Pyx_INCREF(((PyObject *)__pyx_v_result));
18951 __pyx_r = ((PyObject *)__pyx_v_result);
18964 __Pyx_XDECREF(__pyx_t_2);
18965 __Pyx_XDECREF(__pyx_t_3);
18966 __Pyx_AddTraceback(
"View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18969 __Pyx_XDECREF((PyObject *)__pyx_v_result);
18970 __Pyx_XDECREF(__pyx_v_length);
18971 __Pyx_XGIVEREF(__pyx_r);
18972 __Pyx_RefNannyFinishContext();
18984 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
18985 struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
18986 __Pyx_memviewslice *__pyx_r;
18987 __Pyx_RefNannyDeclarations
18990 PyObject *__pyx_t_3 = NULL;
18991 __Pyx_RefNannySetupContext(
"get_slice_from_memview", 0);
19000 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
19001 __pyx_t_2 = (__pyx_t_1 != 0);
19011 if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1056, __pyx_L1_error)
19012 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
19013 __Pyx_INCREF(__pyx_t_3);
19014 __pyx_v_obj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
19024 __pyx_r = (&__pyx_v_obj->from_slice);
19044 __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
19053 __pyx_r = __pyx_v_mslice;
19067 __Pyx_XDECREF(__pyx_t_3);
19068 __Pyx_AddTraceback(
"View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
19071 __Pyx_XDECREF((PyObject *)__pyx_v_obj);
19072 __Pyx_RefNannyFinishContext();
19084 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
19086 Py_ssize_t *__pyx_v_shape;
19087 Py_ssize_t *__pyx_v_strides;
19088 Py_ssize_t *__pyx_v_suboffsets;
19089 __Pyx_RefNannyDeclarations
19090 Py_ssize_t *__pyx_t_1;
19094 Py_ssize_t __pyx_t_5;
19095 __Pyx_RefNannySetupContext(
"slice_copy", 0);
19104 __pyx_t_1 = __pyx_v_memview->view.shape;
19105 __pyx_v_shape = __pyx_t_1;
19114 __pyx_t_1 = __pyx_v_memview->view.strides;
19115 __pyx_v_strides = __pyx_t_1;
19124 __pyx_t_1 = __pyx_v_memview->view.suboffsets;
19125 __pyx_v_suboffsets = __pyx_t_1;
19134 __pyx_v_dst->memview = ((
struct __pyx_memoryview_obj *)__pyx_v_memview);
19143 __pyx_v_dst->data = ((
char *)__pyx_v_memview->view.buf);
19152 __pyx_t_2 = __pyx_v_memview->view.ndim;
19153 __pyx_t_3 = __pyx_t_2;
19154 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19155 __pyx_v_dim = __pyx_t_4;
19164 (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
19173 (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
19182 if ((__pyx_v_suboffsets != 0)) {
19183 __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
19187 (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
19199 __Pyx_RefNannyFinishContext();
19210 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *__pyx_v_memview) {
19211 __Pyx_memviewslice __pyx_v_memviewslice;
19212 PyObject *__pyx_r = NULL;
19213 __Pyx_RefNannyDeclarations
19214 PyObject *__pyx_t_1 = NULL;
19215 __Pyx_RefNannySetupContext(
"memoryview_copy", 0);
19224 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
19233 __Pyx_XDECREF(__pyx_r);
19234 __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1084, __pyx_L1_error)
19235 __Pyx_GOTREF(__pyx_t_1);
19236 __pyx_r = __pyx_t_1;
19250 __Pyx_XDECREF(__pyx_t_1);
19251 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
19254 __Pyx_XGIVEREF(__pyx_r);
19255 __Pyx_RefNannyFinishContext();
19267 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
19268 PyObject *(*__pyx_v_to_object_func)(
char *);
19269 int (*__pyx_v_to_dtype_func)(
char *, PyObject *);
19270 PyObject *__pyx_r = NULL;
19271 __Pyx_RefNannyDeclarations
19274 PyObject *(*__pyx_t_3)(
char *);
19275 int (*__pyx_t_4)(
char *, PyObject *);
19276 PyObject *__pyx_t_5 = NULL;
19277 __Pyx_RefNannySetupContext(
"memoryview_copy_from_slice", 0);
19286 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
19287 __pyx_t_2 = (__pyx_t_1 != 0);
19297 __pyx_t_3 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
19298 __pyx_v_to_object_func = __pyx_t_3;
19307 __pyx_t_4 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
19308 __pyx_v_to_dtype_func = __pyx_t_4;
19328 __pyx_v_to_object_func = NULL;
19337 __pyx_v_to_dtype_func = NULL;
19348 __Pyx_XDECREF(__pyx_r);
19357 __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1101, __pyx_L1_error)
19358 __Pyx_GOTREF(__pyx_t_5);
19359 __pyx_r = __pyx_t_5;
19373 __Pyx_XDECREF(__pyx_t_5);
19374 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
19377 __Pyx_XGIVEREF(__pyx_r);
19378 __Pyx_RefNannyFinishContext();
19390 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
19391 Py_ssize_t __pyx_r;
19401 __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
19411 __pyx_r = (-__pyx_v_arg);
19431 __pyx_r = __pyx_v_arg;
19456 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim) {
19458 Py_ssize_t __pyx_v_c_stride;
19459 Py_ssize_t __pyx_v_f_stride;
19473 __pyx_v_c_stride = 0;
19482 __pyx_v_f_stride = 0;
19491 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
19492 __pyx_v_i = __pyx_t_1;
19501 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
19511 __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
19520 goto __pyx_L4_break;
19540 __pyx_t_1 = __pyx_v_ndim;
19541 __pyx_t_3 = __pyx_t_1;
19542 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19543 __pyx_v_i = __pyx_t_4;
19552 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
19562 __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
19571 goto __pyx_L7_break;
19591 __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
19646 static void _copy_strided_to_strided(
char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides,
char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape,
int __pyx_v_ndim,
size_t __pyx_v_itemsize) {
19647 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
19648 CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
19649 Py_ssize_t __pyx_v_dst_extent;
19650 Py_ssize_t __pyx_v_src_stride;
19651 Py_ssize_t __pyx_v_dst_stride;
19655 Py_ssize_t __pyx_t_4;
19656 Py_ssize_t __pyx_t_5;
19657 Py_ssize_t __pyx_t_6;
19666 __pyx_v_src_extent = (__pyx_v_src_shape[0]);
19675 __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
19684 __pyx_v_src_stride = (__pyx_v_src_strides[0]);
19693 __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
19702 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
19712 __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
19715 __pyx_t_1 = __pyx_t_2;
19716 goto __pyx_L5_bool_binop_done;
19718 __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
19721 __pyx_t_1 = __pyx_t_2;
19722 goto __pyx_L5_bool_binop_done;
19732 __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
19734 __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
19736 __pyx_t_3 = (__pyx_t_2 != 0);
19737 __pyx_t_1 = __pyx_t_3;
19738 __pyx_L5_bool_binop_done:;
19756 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
19776 __pyx_t_4 = __pyx_v_dst_extent;
19777 __pyx_t_5 = __pyx_t_4;
19778 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19779 __pyx_v_i = __pyx_t_6;
19788 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
19797 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
19806 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
19829 __pyx_t_4 = __pyx_v_dst_extent;
19830 __pyx_t_5 = __pyx_t_4;
19831 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19832 __pyx_v_i = __pyx_t_6;
19841 _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
19850 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
19859 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
19883 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_ndim,
size_t __pyx_v_itemsize) {
19892 _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
19913 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src,
int __pyx_v_ndim) {
19914 Py_ssize_t __pyx_v_shape;
19915 Py_ssize_t __pyx_v_size;
19916 Py_ssize_t __pyx_r;
19917 Py_ssize_t __pyx_t_1;
19918 Py_ssize_t *__pyx_t_2;
19919 Py_ssize_t *__pyx_t_3;
19920 Py_ssize_t *__pyx_t_4;
19929 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
19930 __pyx_v_size = __pyx_t_1;
19939 __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
19940 for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
19941 __pyx_t_2 = __pyx_t_4;
19942 __pyx_v_shape = (__pyx_t_2[0]);
19951 __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
19961 __pyx_r = __pyx_v_size;
19985 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride,
int __pyx_v_ndim,
char __pyx_v_order) {
19987 Py_ssize_t __pyx_r;
20000 __pyx_t_1 = ((__pyx_v_order ==
'F') != 0);
20010 __pyx_t_2 = __pyx_v_ndim;
20011 __pyx_t_3 = __pyx_t_2;
20012 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20013 __pyx_v_idx = __pyx_t_4;
20022 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
20031 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
20052 for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
20053 __pyx_v_idx = __pyx_t_2;
20062 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
20071 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
20083 __pyx_r = __pyx_v_stride;
20107 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice,
char __pyx_v_order,
int __pyx_v_ndim) {
20109 void *__pyx_v_result;
20110 size_t __pyx_v_itemsize;
20111 size_t __pyx_v_size;
20113 Py_ssize_t __pyx_t_1;
20116 struct __pyx_memoryview_obj *__pyx_t_4;
20127 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
20128 __pyx_v_itemsize = __pyx_t_1;
20137 __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
20146 __pyx_v_result = malloc(__pyx_v_size);
20155 __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
20165 __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 1224, __pyx_L1_error)
20183 __pyx_v_tmpslice->data = ((
char *)__pyx_v_result);
20192 __pyx_t_4 = __pyx_v_src->memview;
20193 __pyx_v_tmpslice->memview = __pyx_t_4;
20202 __pyx_t_3 = __pyx_v_ndim;
20203 __pyx_t_5 = __pyx_t_3;
20204 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
20205 __pyx_v_i = __pyx_t_6;
20214 (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
20223 (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1
L;
20233 (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
20242 __pyx_t_3 = __pyx_v_ndim;
20243 __pyx_t_5 = __pyx_t_3;
20244 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
20245 __pyx_v_i = __pyx_t_6;
20254 __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
20264 (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
20283 __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
20293 (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
20313 copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
20324 __pyx_r = __pyx_v_result;
20339 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20341 __Pyx_AddTraceback(
"View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
20343 __Pyx_PyGILState_Release(__pyx_gilstate_save);
20359 static int __pyx_memoryview_err_extents(
int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
20361 __Pyx_RefNannyDeclarations
20362 PyObject *__pyx_t_1 = NULL;
20363 PyObject *__pyx_t_2 = NULL;
20364 PyObject *__pyx_t_3 = NULL;
20365 PyObject *__pyx_t_4 = NULL;
20367 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20369 __Pyx_RefNannySetupContext(
"_err_extents", 0);
20378 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
20379 __Pyx_GOTREF(__pyx_t_1);
20380 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1254, __pyx_L1_error)
20381 __Pyx_GOTREF(__pyx_t_2);
20382 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1254, __pyx_L1_error)
20383 __Pyx_GOTREF(__pyx_t_3);
20384 __pyx_t_4 = PyTuple_New(3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1254, __pyx_L1_error)
20385 __Pyx_GOTREF(__pyx_t_4);
20386 __Pyx_GIVEREF(__pyx_t_1);
20387 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
20388 __Pyx_GIVEREF(__pyx_t_2);
20389 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
20390 __Pyx_GIVEREF(__pyx_t_3);
20391 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
20403 __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1253, __pyx_L1_error)
20404 __Pyx_GOTREF(__pyx_t_3);
20405 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20406 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1253, __pyx_L1_error)
20407 __Pyx_GOTREF(__pyx_t_4);
20408 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20409 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
20410 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20411 __PYX_ERR(1, 1253, __pyx_L1_error)
20423 __Pyx_XDECREF(__pyx_t_1);
20424 __Pyx_XDECREF(__pyx_t_2);
20425 __Pyx_XDECREF(__pyx_t_3);
20426 __Pyx_XDECREF(__pyx_t_4);
20427 __Pyx_AddTraceback(
"View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
20429 __Pyx_RefNannyFinishContext();
20431 __Pyx_PyGILState_Release(__pyx_gilstate_save);
20444 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error,
char *__pyx_v_msg,
int __pyx_v_dim) {
20446 __Pyx_RefNannyDeclarations
20447 PyObject *__pyx_t_1 = NULL;
20448 PyObject *__pyx_t_2 = NULL;
20449 PyObject *__pyx_t_3 = NULL;
20450 PyObject *__pyx_t_4 = NULL;
20452 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20454 __Pyx_RefNannySetupContext(
"_err_dim", 0);
20455 __Pyx_INCREF(__pyx_v_error);
20464 __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1258, __pyx_L1_error)
20465 __Pyx_GOTREF(__pyx_t_2);
20466 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1258, __pyx_L1_error)
20467 __Pyx_GOTREF(__pyx_t_3);
20468 __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1258, __pyx_L1_error)
20469 __Pyx_GOTREF(__pyx_t_4);
20470 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20471 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20472 __Pyx_INCREF(__pyx_v_error);
20473 __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
20474 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
20475 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
20476 if (likely(__pyx_t_2)) {
20477 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
20478 __Pyx_INCREF(__pyx_t_2);
20479 __Pyx_INCREF(
function);
20480 __Pyx_DECREF_SET(__pyx_t_3,
function);
20483 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
20484 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20485 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20486 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1258, __pyx_L1_error)
20487 __Pyx_GOTREF(__pyx_t_1);
20488 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20489 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
20490 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20491 __PYX_ERR(1, 1258, __pyx_L1_error)
20503 __Pyx_XDECREF(__pyx_t_1);
20504 __Pyx_XDECREF(__pyx_t_2);
20505 __Pyx_XDECREF(__pyx_t_3);
20506 __Pyx_XDECREF(__pyx_t_4);
20507 __Pyx_AddTraceback(
"View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
20509 __Pyx_XDECREF(__pyx_v_error);
20510 __Pyx_RefNannyFinishContext();
20512 __Pyx_PyGILState_Release(__pyx_gilstate_save);
20525 static int __pyx_memoryview_err(PyObject *__pyx_v_error,
char *__pyx_v_msg) {
20527 __Pyx_RefNannyDeclarations
20529 PyObject *__pyx_t_2 = NULL;
20530 PyObject *__pyx_t_3 = NULL;
20531 PyObject *__pyx_t_4 = NULL;
20532 PyObject *__pyx_t_5 = NULL;
20534 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20536 __Pyx_RefNannySetupContext(
"_err", 0);
20537 __Pyx_INCREF(__pyx_v_error);
20546 __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
20547 if (unlikely(__pyx_t_1)) {
20556 __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1263, __pyx_L1_error)
20557 __Pyx_GOTREF(__pyx_t_3);
20558 __Pyx_INCREF(__pyx_v_error);
20559 __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
20560 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
20561 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
20562 if (likely(__pyx_t_5)) {
20563 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
20564 __Pyx_INCREF(__pyx_t_5);
20565 __Pyx_INCREF(
function);
20566 __Pyx_DECREF_SET(__pyx_t_4,
function);
20569 __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
20570 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20571 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20572 if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1263, __pyx_L1_error)
20573 __Pyx_GOTREF(__pyx_t_2);
20574 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20575 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
20576 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20577 __PYX_ERR(1, 1263, __pyx_L1_error)
20596 __Pyx_Raise(__pyx_v_error, 0, 0, 0);
20597 __PYX_ERR(1, 1265, __pyx_L1_error)
20610 __Pyx_XDECREF(__pyx_t_2);
20611 __Pyx_XDECREF(__pyx_t_3);
20612 __Pyx_XDECREF(__pyx_t_4);
20613 __Pyx_XDECREF(__pyx_t_5);
20614 __Pyx_AddTraceback(
"View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
20616 __Pyx_XDECREF(__pyx_v_error);
20617 __Pyx_RefNannyFinishContext();
20619 __Pyx_PyGILState_Release(__pyx_gilstate_save);
20632 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst,
int __pyx_v_src_ndim,
int __pyx_v_dst_ndim,
int __pyx_v_dtype_is_object) {
20633 void *__pyx_v_tmpdata;
20634 size_t __pyx_v_itemsize;
20636 char __pyx_v_order;
20637 int __pyx_v_broadcasting;
20638 int __pyx_v_direct_copy;
20639 __Pyx_memviewslice __pyx_v_tmp;
20642 Py_ssize_t __pyx_t_1;
20658 __pyx_v_tmpdata = NULL;
20667 __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
20668 __pyx_v_itemsize = __pyx_t_1;
20677 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
20686 __pyx_v_broadcasting = 0;
20695 __pyx_v_direct_copy = 0;
20704 __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
20714 __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
20733 __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
20743 __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
20762 __pyx_t_3 = __pyx_v_dst_ndim;
20763 __pyx_t_4 = __pyx_v_src_ndim;
20764 if (((__pyx_t_3 > __pyx_t_4) != 0)) {
20765 __pyx_t_5 = __pyx_t_3;
20767 __pyx_t_5 = __pyx_t_4;
20769 __pyx_v_ndim = __pyx_t_5;
20778 __pyx_t_5 = __pyx_v_ndim;
20779 __pyx_t_3 = __pyx_t_5;
20780 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20781 __pyx_v_i = __pyx_t_4;
20790 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
20800 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
20810 __pyx_v_broadcasting = 1;
20819 (__pyx_v_src.strides[__pyx_v_i]) = 0;
20839 __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i]));
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 1297, __pyx_L1_error)
20859 __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
20869 __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((
char *)
"Dimension %d is not direct"), __pyx_v_i);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 1300, __pyx_L1_error)
20888 __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
20898 __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
20908 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
20926 __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim);
if (unlikely(__pyx_t_7 == ((
void *)NULL))) __PYX_ERR(1, 1307, __pyx_L1_error)
20927 __pyx_v_tmpdata = __pyx_t_7;
20936 __pyx_v_src = __pyx_v_tmp;
20954 __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
20964 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'C', __pyx_v_ndim) != 0);
20974 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'C', __pyx_v_ndim);
20993 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'F', __pyx_v_ndim) != 0);
21003 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'F', __pyx_v_ndim);
21022 __pyx_t_2 = (__pyx_v_direct_copy != 0);
21032 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
21041 (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
21050 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
21059 free(__pyx_v_tmpdata);
21096 __pyx_t_2 = (__pyx_v_order ==
'F');
21098 __pyx_t_2 = (
'F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
21100 __pyx_t_8 = (__pyx_t_2 != 0);
21110 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(1, 1329, __pyx_L1_error)
21119 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(1, 1330, __pyx_L1_error)
21137 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
21146 copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
21155 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
21164 free(__pyx_v_tmpdata);
21188 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
21190 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
21192 __Pyx_PyGILState_Release(__pyx_gilstate_save);
21208 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim,
int __pyx_v_ndim_other) {
21210 int __pyx_v_offset;
21222 __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
21231 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
21232 __pyx_v_i = __pyx_t_1;
21241 (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
21250 (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
21259 (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
21269 __pyx_t_1 = __pyx_v_offset;
21270 __pyx_t_2 = __pyx_t_1;
21271 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
21272 __pyx_v_i = __pyx_t_3;
21281 (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
21290 (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
21299 (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1
L;
21321 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_dtype_is_object,
int __pyx_v_ndim,
int __pyx_v_inc) {
21331 __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
21341 __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
21371 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
int __pyx_v_inc) {
21372 __Pyx_RefNannyDeclarations
21374 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
21376 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice_with_gil", 0);
21385 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
21396 __Pyx_RefNannyFinishContext();
21398 __Pyx_PyGILState_Release(__pyx_gilstate_save);
21410 static void __pyx_memoryview_refcount_objects_in_slice(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
int __pyx_v_inc) {
21411 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
21412 __Pyx_RefNannyDeclarations
21413 Py_ssize_t __pyx_t_1;
21414 Py_ssize_t __pyx_t_2;
21415 Py_ssize_t __pyx_t_3;
21417 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice", 0);
21426 __pyx_t_1 = (__pyx_v_shape[0]);
21427 __pyx_t_2 = __pyx_t_1;
21428 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
21429 __pyx_v_i = __pyx_t_3;
21438 __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
21448 __pyx_t_4 = (__pyx_v_inc != 0);
21458 Py_INCREF((((PyObject **)__pyx_v_data)[0]));
21478 Py_DECREF((((PyObject **)__pyx_v_data)[0]));
21508 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
21519 __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
21531 __Pyx_RefNannyFinishContext();
21542 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_ndim,
size_t __pyx_v_itemsize,
void *__pyx_v_item,
int __pyx_v_dtype_is_object) {
21551 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
21560 __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
21569 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
21590 static void __pyx_memoryview__slice_assign_scalar(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
size_t __pyx_v_itemsize,
void *__pyx_v_item) {
21591 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
21592 Py_ssize_t __pyx_v_stride;
21593 Py_ssize_t __pyx_v_extent;
21595 Py_ssize_t __pyx_t_2;
21596 Py_ssize_t __pyx_t_3;
21597 Py_ssize_t __pyx_t_4;
21606 __pyx_v_stride = (__pyx_v_strides[0]);
21615 __pyx_v_extent = (__pyx_v_shape[0]);
21624 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
21634 __pyx_t_2 = __pyx_v_extent;
21635 __pyx_t_3 = __pyx_t_2;
21636 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
21637 __pyx_v_i = __pyx_t_4;
21646 (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
21655 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
21676 __pyx_t_2 = __pyx_v_extent;
21677 __pyx_t_3 = __pyx_t_2;
21678 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
21679 __pyx_v_i = __pyx_t_4;
21688 __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
21697 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
21720 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
21721 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {
"__pyx_unpickle_Enum", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
21722 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
21723 PyObject *__pyx_v___pyx_type = 0;
21724 long __pyx_v___pyx_checksum;
21725 PyObject *__pyx_v___pyx_state = 0;
21726 PyObject *__pyx_r = 0;
21727 __Pyx_RefNannyDeclarations
21728 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum (wrapper)", 0);
21730 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
21731 PyObject* values[3] = {0,0,0};
21732 if (unlikely(__pyx_kwds)) {
21733 Py_ssize_t kw_args;
21734 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
21735 switch (pos_args) {
21736 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
21737 CYTHON_FALLTHROUGH;
21738 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
21739 CYTHON_FALLTHROUGH;
21740 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
21741 CYTHON_FALLTHROUGH;
21743 default:
goto __pyx_L5_argtuple_error;
21745 kw_args = PyDict_Size(__pyx_kwds);
21746 switch (pos_args) {
21748 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
21749 else goto __pyx_L5_argtuple_error;
21750 CYTHON_FALLTHROUGH;
21752 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
21754 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
21756 CYTHON_FALLTHROUGH;
21758 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
21760 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
21763 if (unlikely(kw_args > 0)) {
21764 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
21766 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
21767 goto __pyx_L5_argtuple_error;
21769 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
21770 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
21771 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
21773 __pyx_v___pyx_type = values[0];
21774 __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]);
if (unlikely((__pyx_v___pyx_checksum == (
long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
21775 __pyx_v___pyx_state = values[2];
21777 goto __pyx_L4_argument_unpacking_done;
21778 __pyx_L5_argtuple_error:;
21779 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
21781 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
21782 __Pyx_RefNannyFinishContext();
21784 __pyx_L4_argument_unpacking_done:;
21785 __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
21788 __Pyx_RefNannyFinishContext();
21792 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
21793 PyObject *__pyx_v___pyx_PickleError = 0;
21794 PyObject *__pyx_v___pyx_result = 0;
21795 PyObject *__pyx_r = NULL;
21796 __Pyx_RefNannyDeclarations
21798 PyObject *__pyx_t_2 = NULL;
21799 PyObject *__pyx_t_3 = NULL;
21800 PyObject *__pyx_t_4 = NULL;
21801 PyObject *__pyx_t_5 = NULL;
21803 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum", 0);
21812 __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0);
21822 __pyx_t_2 = PyList_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
21823 __Pyx_GOTREF(__pyx_t_2);
21824 __Pyx_INCREF(__pyx_n_s_PickleError);
21825 __Pyx_GIVEREF(__pyx_n_s_PickleError);
21826 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
21827 __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
21828 __Pyx_GOTREF(__pyx_t_3);
21829 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21830 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
21831 __Pyx_GOTREF(__pyx_t_2);
21832 __Pyx_INCREF(__pyx_t_2);
21833 __pyx_v___pyx_PickleError = __pyx_t_2;
21834 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21835 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21844 __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
21845 __Pyx_GOTREF(__pyx_t_2);
21846 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
21847 __Pyx_GOTREF(__pyx_t_4);
21848 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21849 __Pyx_INCREF(__pyx_v___pyx_PickleError);
21850 __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
21851 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
21852 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
21853 if (likely(__pyx_t_5)) {
21854 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
21855 __Pyx_INCREF(__pyx_t_5);
21856 __Pyx_INCREF(
function);
21857 __Pyx_DECREF_SET(__pyx_t_2,
function);
21860 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
21861 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
21862 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21863 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
21864 __Pyx_GOTREF(__pyx_t_3);
21865 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21866 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
21867 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21868 __PYX_ERR(1, 6, __pyx_L1_error)
21886 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
21887 __Pyx_GOTREF(__pyx_t_2);
21889 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
21890 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
21891 if (likely(__pyx_t_4)) {
21892 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
21893 __Pyx_INCREF(__pyx_t_4);
21894 __Pyx_INCREF(
function);
21895 __Pyx_DECREF_SET(__pyx_t_2,
function);
21898 __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
21899 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
21900 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
21901 __Pyx_GOTREF(__pyx_t_3);
21902 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21903 __pyx_v___pyx_result = __pyx_t_3;
21913 __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
21914 __pyx_t_6 = (__pyx_t_1 != 0);
21924 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
21925 __pyx_t_3 = __pyx_unpickle_Enum__set_state(((
struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
21926 __Pyx_GOTREF(__pyx_t_3);
21927 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21945 __Pyx_XDECREF(__pyx_r);
21946 __Pyx_INCREF(__pyx_v___pyx_result);
21947 __pyx_r = __pyx_v___pyx_result;
21958 __Pyx_XDECREF(__pyx_t_2);
21959 __Pyx_XDECREF(__pyx_t_3);
21960 __Pyx_XDECREF(__pyx_t_4);
21961 __Pyx_XDECREF(__pyx_t_5);
21962 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
21965 __Pyx_XDECREF(__pyx_v___pyx_PickleError);
21966 __Pyx_XDECREF(__pyx_v___pyx_result);
21967 __Pyx_XGIVEREF(__pyx_r);
21968 __Pyx_RefNannyFinishContext();
21980 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
21981 PyObject *__pyx_r = NULL;
21982 __Pyx_RefNannyDeclarations
21983 PyObject *__pyx_t_1 = NULL;
21985 Py_ssize_t __pyx_t_3;
21988 PyObject *__pyx_t_6 = NULL;
21989 PyObject *__pyx_t_7 = NULL;
21990 PyObject *__pyx_t_8 = NULL;
21991 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum__set_state", 0);
22000 if (unlikely(__pyx_v___pyx_state == Py_None)) {
22001 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
22002 __PYX_ERR(1, 12, __pyx_L1_error)
22004 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
22005 __Pyx_GOTREF(__pyx_t_1);
22006 __Pyx_GIVEREF(__pyx_t_1);
22007 __Pyx_GOTREF(__pyx_v___pyx_result->name);
22008 __Pyx_DECREF(__pyx_v___pyx_result->name);
22009 __pyx_v___pyx_result->name = __pyx_t_1;
22018 if (unlikely(__pyx_v___pyx_state == Py_None)) {
22019 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
22020 __PYX_ERR(1, 13, __pyx_L1_error)
22022 __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state);
if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
22023 __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
22026 __pyx_t_2 = __pyx_t_4;
22027 goto __pyx_L4_bool_binop_done;
22029 __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
22030 __pyx_t_5 = (__pyx_t_4 != 0);
22031 __pyx_t_2 = __pyx_t_5;
22032 __pyx_L4_bool_binop_done:;
22040 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
22041 __Pyx_GOTREF(__pyx_t_6);
22042 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
22043 __Pyx_GOTREF(__pyx_t_7);
22044 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22045 if (unlikely(__pyx_v___pyx_state == Py_None)) {
22046 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
22047 __PYX_ERR(1, 14, __pyx_L1_error)
22049 __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
22050 __Pyx_GOTREF(__pyx_t_6);
22052 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
22053 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
22054 if (likely(__pyx_t_8)) {
22055 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
22056 __Pyx_INCREF(__pyx_t_8);
22057 __Pyx_INCREF(
function);
22058 __Pyx_DECREF_SET(__pyx_t_7,
function);
22061 __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
22062 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
22063 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22064 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
22065 __Pyx_GOTREF(__pyx_t_1);
22066 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22067 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22086 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
22089 __Pyx_XDECREF(__pyx_t_1);
22090 __Pyx_XDECREF(__pyx_t_6);
22091 __Pyx_XDECREF(__pyx_t_7);
22092 __Pyx_XDECREF(__pyx_t_8);
22093 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
22096 __Pyx_XGIVEREF(__pyx_r);
22097 __Pyx_RefNannyFinishContext();
22101 static PyObject *__pyx_tp_new_10csmoothers_cASMFactor(PyTypeObject *t, PyObject *a, PyObject *k) {
22103 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22104 o = (*t->tp_alloc)(t, 0);
22106 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22108 if (unlikely(!o))
return 0;
22109 if (unlikely(__pyx_pw_10csmoothers_10cASMFactor_1__cinit__(o, a, k) < 0))
goto bad;
22112 Py_DECREF(o); o = 0;
22116 static void __pyx_tp_dealloc_10csmoothers_cASMFactor(PyObject *o) {
22117 #if CYTHON_USE_TP_FINALIZE 22118 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
22119 if (PyObject_CallFinalizerFromDealloc(o))
return;
22123 PyObject *etype, *eval, *etb;
22124 PyErr_Fetch(&etype, &eval, &etb);
22126 __pyx_pw_10csmoothers_10cASMFactor_3__dealloc__(o);
22128 PyErr_Restore(etype, eval, etb);
22130 (*Py_TYPE(o)->tp_free)(o);
22133 static PyMethodDef __pyx_methods_10csmoothers_cASMFactor[] = {
22134 {
"__reduce_cython__", (PyCFunction)__pyx_pw_10csmoothers_10cASMFactor_5__reduce_cython__, METH_NOARGS, 0},
22135 {
"__setstate_cython__", (PyCFunction)__pyx_pw_10csmoothers_10cASMFactor_7__setstate_cython__, METH_O, 0},
22139 static PyTypeObject __pyx_type_10csmoothers_cASMFactor = {
22140 PyVarObject_HEAD_INIT(0, 0)
22141 "csmoothers.cASMFactor",
22142 sizeof(
struct __pyx_obj_10csmoothers_cASMFactor),
22144 __pyx_tp_dealloc_10csmoothers_cASMFactor,
22145 #
if PY_VERSION_HEX < 0x030800b4
22148 #
if PY_VERSION_HEX >= 0x030800b4
22153 #
if PY_MAJOR_VERSION < 3
22156 #
if PY_MAJOR_VERSION >= 3
22169 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
22177 __pyx_methods_10csmoothers_cASMFactor,
22187 __pyx_tp_new_10csmoothers_cASMFactor,
22197 #
if PY_VERSION_HEX >= 0x030400a1
22200 #
if PY_VERSION_HEX >= 0x030800b1
22203 #
if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22208 static PyObject *__pyx_tp_new_10csmoothers_cBASMFactor(PyTypeObject *t, PyObject *a, PyObject *k) {
22210 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22211 o = (*t->tp_alloc)(t, 0);
22213 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22215 if (unlikely(!o))
return 0;
22216 if (unlikely(__pyx_pw_10csmoothers_11cBASMFactor_1__cinit__(o, a, k) < 0))
goto bad;
22219 Py_DECREF(o); o = 0;
22223 static void __pyx_tp_dealloc_10csmoothers_cBASMFactor(PyObject *o) {
22224 #if CYTHON_USE_TP_FINALIZE 22225 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
22226 if (PyObject_CallFinalizerFromDealloc(o))
return;
22230 PyObject *etype, *eval, *etb;
22231 PyErr_Fetch(&etype, &eval, &etb);
22233 __pyx_pw_10csmoothers_11cBASMFactor_3__dealloc__(o);
22235 PyErr_Restore(etype, eval, etb);
22237 (*Py_TYPE(o)->tp_free)(o);
22240 static PyMethodDef __pyx_methods_10csmoothers_cBASMFactor[] = {
22241 {
"__reduce_cython__", (PyCFunction)__pyx_pw_10csmoothers_11cBASMFactor_5__reduce_cython__, METH_NOARGS, 0},
22242 {
"__setstate_cython__", (PyCFunction)__pyx_pw_10csmoothers_11cBASMFactor_7__setstate_cython__, METH_O, 0},
22246 static PyTypeObject __pyx_type_10csmoothers_cBASMFactor = {
22247 PyVarObject_HEAD_INIT(0, 0)
22248 "csmoothers.cBASMFactor",
22249 sizeof(
struct __pyx_obj_10csmoothers_cBASMFactor),
22251 __pyx_tp_dealloc_10csmoothers_cBASMFactor,
22252 #
if PY_VERSION_HEX < 0x030800b4
22255 #
if PY_VERSION_HEX >= 0x030800b4
22260 #
if PY_MAJOR_VERSION < 3
22263 #
if PY_MAJOR_VERSION >= 3
22276 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
22284 __pyx_methods_10csmoothers_cBASMFactor,
22294 __pyx_tp_new_10csmoothers_cBASMFactor,
22304 #
if PY_VERSION_HEX >= 0x030400a1
22307 #
if PY_VERSION_HEX >= 0x030800b1
22310 #
if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22314 static struct __pyx_vtabstruct_array __pyx_vtable_array;
22316 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
22317 struct __pyx_array_obj *p;
22319 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22320 o = (*t->tp_alloc)(t, 0);
22322 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22324 if (unlikely(!o))
return 0;
22325 p = ((
struct __pyx_array_obj *)o);
22326 p->__pyx_vtab = __pyx_vtabptr_array;
22327 p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
22328 p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
22329 if (unlikely(__pyx_array___cinit__(o, a, k) < 0))
goto bad;
22332 Py_DECREF(o); o = 0;
22336 static void __pyx_tp_dealloc_array(PyObject *o) {
22337 struct __pyx_array_obj *p = (
struct __pyx_array_obj *)o;
22338 #if CYTHON_USE_TP_FINALIZE 22339 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
22340 if (PyObject_CallFinalizerFromDealloc(o))
return;
22344 PyObject *etype, *eval, *etb;
22345 PyErr_Fetch(&etype, &eval, &etb);
22347 __pyx_array___dealloc__(o);
22349 PyErr_Restore(etype, eval, etb);
22352 Py_CLEAR(p->_format);
22353 (*Py_TYPE(o)->tp_free)(o);
22355 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
22357 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
22358 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
22363 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *
v) {
22365 return __pyx_array___setitem__(o, i, v);
22368 PyErr_Format(PyExc_NotImplementedError,
22369 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
22374 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *
n) {
22375 PyObject *
v = __Pyx_PyObject_GenericGetAttr(o, n);
22376 if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
22378 v = __pyx_array___getattr__(o, n);
22383 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED
void *x) {
22384 return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
22387 static PyMethodDef __pyx_methods_array[] = {
22388 {
"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
22389 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
22390 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
22394 static struct PyGetSetDef __pyx_getsets_array[] = {
22395 {(
char *)
"memview", __pyx_getprop___pyx_array_memview, 0, (
char *)0, 0},
22399 static PySequenceMethods __pyx_tp_as_sequence_array = {
22400 __pyx_array___len__,
22403 __pyx_sq_item_array,
22412 static PyMappingMethods __pyx_tp_as_mapping_array = {
22413 __pyx_array___len__,
22414 __pyx_array___getitem__,
22415 __pyx_mp_ass_subscript_array,
22418 static PyBufferProcs __pyx_tp_as_buffer_array = {
22419 #if PY_MAJOR_VERSION < 3 22422 #if PY_MAJOR_VERSION < 3 22425 #if PY_MAJOR_VERSION < 3 22428 #if PY_MAJOR_VERSION < 3 22431 __pyx_array_getbuffer,
22435 static PyTypeObject __pyx_type___pyx_array = {
22436 PyVarObject_HEAD_INIT(0, 0)
22437 "csmoothers.array",
22438 sizeof(
struct __pyx_array_obj),
22440 __pyx_tp_dealloc_array,
22441 #
if PY_VERSION_HEX < 0x030800b4
22444 #
if PY_VERSION_HEX >= 0x030800b4
22449 #
if PY_MAJOR_VERSION < 3
22452 #
if PY_MAJOR_VERSION >= 3
22457 &__pyx_tp_as_sequence_array,
22458 &__pyx_tp_as_mapping_array,
22462 __pyx_tp_getattro_array,
22464 &__pyx_tp_as_buffer_array,
22465 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
22473 __pyx_methods_array,
22475 __pyx_getsets_array,
22483 __pyx_tp_new_array,
22493 #
if PY_VERSION_HEX >= 0x030400a1
22496 #
if PY_VERSION_HEX >= 0x030800b1
22499 #
if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22504 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
22505 struct __pyx_MemviewEnum_obj *p;
22507 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22508 o = (*t->tp_alloc)(t, 0);
22510 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22512 if (unlikely(!o))
return 0;
22513 p = ((
struct __pyx_MemviewEnum_obj *)o);
22514 p->name = Py_None; Py_INCREF(Py_None);
22518 static void __pyx_tp_dealloc_Enum(PyObject *o) {
22519 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
22520 #if CYTHON_USE_TP_FINALIZE 22521 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22522 if (PyObject_CallFinalizerFromDealloc(o))
return;
22525 PyObject_GC_UnTrack(o);
22527 (*Py_TYPE(o)->tp_free)(o);
22530 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc
v,
void *a) {
22532 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
22534 e = (*v)(p->name, a);
if (e)
return e;
22539 static int __pyx_tp_clear_Enum(PyObject *o) {
22541 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
22542 tmp = ((PyObject*)p->name);
22543 p->name = Py_None; Py_INCREF(Py_None);
22548 static PyMethodDef __pyx_methods_Enum[] = {
22549 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
22550 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
22554 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
22555 PyVarObject_HEAD_INIT(0, 0)
22557 sizeof(
struct __pyx_MemviewEnum_obj),
22559 __pyx_tp_dealloc_Enum,
22560 #
if PY_VERSION_HEX < 0x030800b4
22563 #
if PY_VERSION_HEX >= 0x030800b4
22568 #
if PY_MAJOR_VERSION < 3
22571 #
if PY_MAJOR_VERSION >= 3
22574 __pyx_MemviewEnum___repr__,
22584 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
22586 __pyx_tp_traverse_Enum,
22587 __pyx_tp_clear_Enum,
22592 __pyx_methods_Enum,
22600 __pyx_MemviewEnum___init__,
22612 #
if PY_VERSION_HEX >= 0x030400a1
22615 #
if PY_VERSION_HEX >= 0x030800b1
22618 #
if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22622 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
22624 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
22625 struct __pyx_memoryview_obj *p;
22627 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22628 o = (*t->tp_alloc)(t, 0);
22630 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22632 if (unlikely(!o))
return 0;
22633 p = ((
struct __pyx_memoryview_obj *)o);
22634 p->__pyx_vtab = __pyx_vtabptr_memoryview;
22635 p->obj = Py_None; Py_INCREF(Py_None);
22636 p->_size = Py_None; Py_INCREF(Py_None);
22637 p->_array_interface = Py_None; Py_INCREF(Py_None);
22638 p->view.obj = NULL;
22639 if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0))
goto bad;
22642 Py_DECREF(o); o = 0;
22646 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
22647 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
22648 #if CYTHON_USE_TP_FINALIZE 22649 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22650 if (PyObject_CallFinalizerFromDealloc(o))
return;
22653 PyObject_GC_UnTrack(o);
22655 PyObject *etype, *eval, *etb;
22656 PyErr_Fetch(&etype, &eval, &etb);
22658 __pyx_memoryview___dealloc__(o);
22660 PyErr_Restore(etype, eval, etb);
22663 Py_CLEAR(p->_size);
22664 Py_CLEAR(p->_array_interface);
22665 (*Py_TYPE(o)->tp_free)(o);
22668 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc
v,
void *a) {
22670 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
22672 e = (*v)(p->obj, a);
if (e)
return e;
22675 e = (*v)(p->_size, a);
if (e)
return e;
22677 if (p->_array_interface) {
22678 e = (*v)(p->_array_interface, a);
if (e)
return e;
22681 e = (*v)(p->view.obj, a);
if (e)
return e;
22686 static int __pyx_tp_clear_memoryview(PyObject *o) {
22688 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
22689 tmp = ((PyObject*)p->obj);
22690 p->obj = Py_None; Py_INCREF(Py_None);
22692 tmp = ((PyObject*)p->_size);
22693 p->_size = Py_None; Py_INCREF(Py_None);
22695 tmp = ((PyObject*)p->_array_interface);
22696 p->_array_interface = Py_None; Py_INCREF(Py_None);
22698 Py_CLEAR(p->view.obj);
22701 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
22703 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
22704 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
22709 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *
v) {
22711 return __pyx_memoryview___setitem__(o, i, v);
22714 PyErr_Format(PyExc_NotImplementedError,
22715 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
22720 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED
void *x) {
22721 return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
22724 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED
void *x) {
22725 return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
22728 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED
void *x) {
22729 return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
22732 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED
void *x) {
22733 return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
22736 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED
void *x) {
22737 return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
22740 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED
void *x) {
22741 return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
22744 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED
void *x) {
22745 return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
22748 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED
void *x) {
22749 return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
22752 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED
void *x) {
22753 return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
22756 static PyMethodDef __pyx_methods_memoryview[] = {
22757 {
"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
22758 {
"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
22759 {
"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
22760 {
"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
22761 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
22762 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
22766 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
22767 {(
char *)
"T", __pyx_getprop___pyx_memoryview_T, 0, (
char *)0, 0},
22768 {(
char *)
"base", __pyx_getprop___pyx_memoryview_base, 0, (
char *)0, 0},
22769 {(
char *)
"shape", __pyx_getprop___pyx_memoryview_shape, 0, (
char *)0, 0},
22770 {(
char *)
"strides", __pyx_getprop___pyx_memoryview_strides, 0, (
char *)0, 0},
22771 {(
char *)
"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (
char *)0, 0},
22772 {(
char *)
"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (
char *)0, 0},
22773 {(
char *)
"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (
char *)0, 0},
22774 {(
char *)
"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (
char *)0, 0},
22775 {(
char *)
"size", __pyx_getprop___pyx_memoryview_size, 0, (
char *)0, 0},
22779 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
22780 __pyx_memoryview___len__,
22783 __pyx_sq_item_memoryview,
22792 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
22793 __pyx_memoryview___len__,
22794 __pyx_memoryview___getitem__,
22795 __pyx_mp_ass_subscript_memoryview,
22798 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
22799 #if PY_MAJOR_VERSION < 3 22802 #if PY_MAJOR_VERSION < 3 22805 #if PY_MAJOR_VERSION < 3 22808 #if PY_MAJOR_VERSION < 3 22811 __pyx_memoryview_getbuffer,
22815 static PyTypeObject __pyx_type___pyx_memoryview = {
22816 PyVarObject_HEAD_INIT(0, 0)
22817 "csmoothers.memoryview",
22818 sizeof(
struct __pyx_memoryview_obj),
22820 __pyx_tp_dealloc_memoryview,
22821 #
if PY_VERSION_HEX < 0x030800b4
22824 #
if PY_VERSION_HEX >= 0x030800b4
22829 #
if PY_MAJOR_VERSION < 3
22832 #
if PY_MAJOR_VERSION >= 3
22835 __pyx_memoryview___repr__,
22837 &__pyx_tp_as_sequence_memoryview,
22838 &__pyx_tp_as_mapping_memoryview,
22841 __pyx_memoryview___str__,
22844 &__pyx_tp_as_buffer_memoryview,
22845 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
22847 __pyx_tp_traverse_memoryview,
22848 __pyx_tp_clear_memoryview,
22853 __pyx_methods_memoryview,
22855 __pyx_getsets_memoryview,
22863 __pyx_tp_new_memoryview,
22873 #
if PY_VERSION_HEX >= 0x030400a1
22876 #
if PY_VERSION_HEX >= 0x030800b1
22879 #
if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22883 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
22885 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
22886 struct __pyx_memoryviewslice_obj *p;
22887 PyObject *o = __pyx_tp_new_memoryview(t, a, k);
22888 if (unlikely(!o))
return 0;
22889 p = ((
struct __pyx_memoryviewslice_obj *)o);
22890 p->__pyx_base.__pyx_vtab = (
struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
22891 p->from_object = Py_None; Py_INCREF(Py_None);
22892 p->from_slice.memview = NULL;
22896 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
22897 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
22898 #if CYTHON_USE_TP_FINALIZE 22899 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22900 if (PyObject_CallFinalizerFromDealloc(o))
return;
22903 PyObject_GC_UnTrack(o);
22905 PyObject *etype, *eval, *etb;
22906 PyErr_Fetch(&etype, &eval, &etb);
22908 __pyx_memoryviewslice___dealloc__(o);
22910 PyErr_Restore(etype, eval, etb);
22912 Py_CLEAR(p->from_object);
22913 PyObject_GC_Track(o);
22914 __pyx_tp_dealloc_memoryview(o);
22917 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc
v,
void *a) {
22919 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
22920 e = __pyx_tp_traverse_memoryview(o,
v, a);
if (e)
return e;
22921 if (p->from_object) {
22922 e = (*v)(p->from_object, a);
if (e)
return e;
22927 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
22929 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
22930 __pyx_tp_clear_memoryview(o);
22931 tmp = ((PyObject*)p->from_object);
22932 p->from_object = Py_None; Py_INCREF(Py_None);
22934 __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
22938 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED
void *x) {
22939 return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
22942 static PyMethodDef __pyx_methods__memoryviewslice[] = {
22943 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
22944 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
22948 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
22949 {(
char *)
"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (
char *)0, 0},
22953 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
22954 PyVarObject_HEAD_INIT(0, 0)
22955 "csmoothers._memoryviewslice",
22956 sizeof(
struct __pyx_memoryviewslice_obj),
22958 __pyx_tp_dealloc__memoryviewslice,
22959 #
if PY_VERSION_HEX < 0x030800b4
22962 #
if PY_VERSION_HEX >= 0x030800b4
22967 #
if PY_MAJOR_VERSION < 3
22970 #
if PY_MAJOR_VERSION >= 3
22973 #
if CYTHON_COMPILING_IN_PYPY
22974 __pyx_memoryview___repr__,
22983 #
if CYTHON_COMPILING_IN_PYPY
22984 __pyx_memoryview___str__,
22991 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
22992 "Internal class for passing memoryview slices to Python",
22993 __pyx_tp_traverse__memoryviewslice,
22994 __pyx_tp_clear__memoryviewslice,
22999 __pyx_methods__memoryviewslice,
23001 __pyx_getsets__memoryviewslice,
23009 __pyx_tp_new__memoryviewslice,
23019 #
if PY_VERSION_HEX >= 0x030400a1
23022 #
if PY_VERSION_HEX >= 0x030800b1
23025 #
if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
23030 static PyMethodDef __pyx_methods[] = {
23034 #if PY_MAJOR_VERSION >= 3 23035 #if CYTHON_PEP489_MULTI_PHASE_INIT 23036 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
23037 static int __pyx_pymod_exec_csmoothers(PyObject* module);
23038 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
23039 {Py_mod_create, (
void*)__pyx_pymod_create},
23040 {Py_mod_exec, (
void*)__pyx_pymod_exec_csmoothers},
23045 static struct PyModuleDef __pyx_moduledef = {
23046 PyModuleDef_HEAD_INIT,
23049 #if CYTHON_PEP489_MULTI_PHASE_INIT 23055 #if CYTHON_PEP489_MULTI_PHASE_INIT 23056 __pyx_moduledef_slots,
23065 #ifndef CYTHON_SMALL_CODE 23066 #if defined(__clang__) 23067 #define CYTHON_SMALL_CODE 23068 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) 23069 #define CYTHON_SMALL_CODE __attribute__((cold)) 23071 #define CYTHON_SMALL_CODE 23075 static __Pyx_StringTabEntry __pyx_string_tab[] = {
23076 {&__pyx_n_s_A, __pyx_k_A,
sizeof(__pyx_k_A), 0, 0, 1, 1},
23077 {&__pyx_n_s_ASCII, __pyx_k_ASCII,
sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
23078 {&__pyx_n_s_ASMFactor, __pyx_k_ASMFactor,
sizeof(__pyx_k_ASMFactor), 0, 0, 1, 1},
23079 {&__pyx_n_s_ASMFactor___init, __pyx_k_ASMFactor___init,
sizeof(__pyx_k_ASMFactor___init), 0, 0, 1, 1},
23080 {&__pyx_n_s_BASMFactor, __pyx_k_BASMFactor,
sizeof(__pyx_k_BASMFactor), 0, 0, 1, 1},
23081 {&__pyx_n_s_BASMFactor___init, __pyx_k_BASMFactor___init,
sizeof(__pyx_k_BASMFactor___init), 0, 0, 1, 1},
23082 {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri,
sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
23083 {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is,
sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
23084 {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor,
sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
23085 {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi,
sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
23086 {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s,
sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
23087 {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis,
sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
23088 {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr,
sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
23089 {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor,
sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
23090 {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2,
sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
23091 {&__pyx_n_s_ImportError, __pyx_k_ImportError,
sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
23092 {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0,
sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0},
23093 {&__pyx_n_s_IndexError, __pyx_k_IndexError,
sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
23094 {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte,
sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
23095 {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr,
sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
23096 {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d,
sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
23097 {&__pyx_n_s_L, __pyx_k_L,
sizeof(__pyx_k_L), 0, 0, 1, 1},
23098 {&__pyx_n_s_M, __pyx_k_M,
sizeof(__pyx_k_M), 0, 0, 1, 1},
23099 {&__pyx_n_s_MemoryError, __pyx_k_MemoryError,
sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
23100 {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x,
sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
23101 {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object,
sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
23102 {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor,
sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
23103 {&__pyx_n_b_O, __pyx_k_O,
sizeof(__pyx_k_O), 0, 0, 0, 1},
23104 {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a,
sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
23105 {&__pyx_n_s_PickleError, __pyx_k_PickleError,
sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
23106 {&__pyx_n_s_R, __pyx_k_R,
sizeof(__pyx_k_R), 0, 0, 1, 1},
23107 {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError,
sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
23108 {&__pyx_n_s_TypeError, __pyx_k_TypeError,
sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
23109 {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object,
sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
23110 {&__pyx_n_s_ValueError, __pyx_k_ValueError,
sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
23111 {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView,
sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
23112 {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer,
sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
23113 {&__pyx_n_s_asmFactor, __pyx_k_asmFactor,
sizeof(__pyx_k_asmFactor), 0, 0, 1, 1},
23114 {&__pyx_n_s_asm_NR_prepare, __pyx_k_asm_NR_prepare,
sizeof(__pyx_k_asm_NR_prepare), 0, 0, 1, 1},
23115 {&__pyx_n_s_asm_NR_solve, __pyx_k_asm_NR_solve,
sizeof(__pyx_k_asm_NR_solve), 0, 0, 1, 1},
23116 {&__pyx_n_s_base, __pyx_k_base,
sizeof(__pyx_k_base), 0, 0, 1, 1},
23117 {&__pyx_n_s_basmFactor, __pyx_k_basmFactor,
sizeof(__pyx_k_basmFactor), 0, 0, 1, 1},
23118 {&__pyx_n_s_basm_NR_prepare, __pyx_k_basm_NR_prepare,
sizeof(__pyx_k_basm_NR_prepare), 0, 0, 1, 1},
23119 {&__pyx_n_s_basm_NR_solve, __pyx_k_basm_NR_solve,
sizeof(__pyx_k_basm_NR_solve), 0, 0, 1, 1},
23120 {&__pyx_n_s_bs, __pyx_k_bs,
sizeof(__pyx_k_bs), 0, 0, 1, 1},
23121 {&__pyx_n_s_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 0, 1, 1},
23122 {&__pyx_n_u_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 1, 0, 1},
23123 {&__pyx_n_s_cASMFactor, __pyx_k_cASMFactor,
sizeof(__pyx_k_cASMFactor), 0, 0, 1, 1},
23124 {&__pyx_n_s_cASMFactor_2, __pyx_k_cASMFactor_2,
sizeof(__pyx_k_cASMFactor_2), 0, 0, 1, 1},
23125 {&__pyx_n_s_cBASMFactor, __pyx_k_cBASMFactor,
sizeof(__pyx_k_cBASMFactor), 0, 0, 1, 1},
23126 {&__pyx_n_s_cBASMFactor_2, __pyx_k_cBASMFactor_2,
sizeof(__pyx_k_cBASMFactor_2), 0, 0, 1, 1},
23127 {&__pyx_n_s_cSparseMatrix, __pyx_k_cSparseMatrix,
sizeof(__pyx_k_cSparseMatrix), 0, 0, 1, 1},
23128 {&__pyx_n_s_class, __pyx_k_class,
sizeof(__pyx_k_class), 0, 0, 1, 1},
23129 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
23130 {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct,
sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
23131 {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect,
sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
23132 {&__pyx_n_s_csmoothers, __pyx_k_csmoothers,
sizeof(__pyx_k_csmoothers), 0, 0, 1, 1},
23133 {&__pyx_n_s_dX, __pyx_k_dX,
sizeof(__pyx_k_dX), 0, 0, 1, 1},
23134 {&__pyx_n_s_dict, __pyx_k_dict,
sizeof(__pyx_k_dict), 0, 0, 1, 1},
23135 {&__pyx_n_s_doc, __pyx_k_doc,
sizeof(__pyx_k_doc), 0, 0, 1, 1},
23136 {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object,
sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
23137 {&__pyx_n_s_encode, __pyx_k_encode,
sizeof(__pyx_k_encode), 0, 0, 1, 1},
23138 {&__pyx_n_s_enumerate, __pyx_k_enumerate,
sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
23139 {&__pyx_n_s_error, __pyx_k_error,
sizeof(__pyx_k_error), 0, 0, 1, 1},
23140 {&__pyx_n_s_flags, __pyx_k_flags,
sizeof(__pyx_k_flags), 0, 0, 1, 1},
23141 {&__pyx_n_s_format, __pyx_k_format,
sizeof(__pyx_k_format), 0, 0, 1, 1},
23142 {&__pyx_n_s_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 0, 1, 1},
23143 {&__pyx_n_u_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 1, 0, 1},
23144 {&__pyx_n_s_gauss_seidel_NR_preare, __pyx_k_gauss_seidel_NR_preare,
sizeof(__pyx_k_gauss_seidel_NR_preare), 0, 0, 1, 1},
23145 {&__pyx_n_s_gauss_seidel_NR_solve, __pyx_k_gauss_seidel_NR_solve,
sizeof(__pyx_k_gauss_seidel_NR_solve), 0, 0, 1, 1},
23146 {&__pyx_n_s_getstate, __pyx_k_getstate,
sizeof(__pyx_k_getstate), 0, 0, 1, 1},
23147 {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi,
sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
23148 {&__pyx_n_s_id, __pyx_k_id,
sizeof(__pyx_k_id), 0, 0, 1, 1},
23149 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
23150 {&__pyx_n_s_init, __pyx_k_init,
sizeof(__pyx_k_init), 0, 0, 1, 1},
23151 {&__pyx_n_s_itemsize, __pyx_k_itemsize,
sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
23152 {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array,
sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
23153 {&__pyx_n_s_jacobi_NR_prepare, __pyx_k_jacobi_NR_prepare,
sizeof(__pyx_k_jacobi_NR_prepare), 0, 0, 1, 1},
23154 {&__pyx_n_s_jacobi_NR_solve, __pyx_k_jacobi_NR_solve,
sizeof(__pyx_k_jacobi_NR_solve), 0, 0, 1, 1},
23155 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
23156 {&__pyx_n_s_memview, __pyx_k_memview,
sizeof(__pyx_k_memview), 0, 0, 1, 1},
23157 {&__pyx_n_s_metaclass, __pyx_k_metaclass,
sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
23158 {&__pyx_n_s_mode, __pyx_k_mode,
sizeof(__pyx_k_mode), 0, 0, 1, 1},
23159 {&__pyx_n_s_module, __pyx_k_module,
sizeof(__pyx_k_module), 0, 0, 1, 1},
23160 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
23161 {&__pyx_n_s_name_2, __pyx_k_name_2,
sizeof(__pyx_k_name_2), 0, 0, 1, 1},
23162 {&__pyx_n_s_nc, __pyx_k_nc,
sizeof(__pyx_k_nc), 0, 0, 1, 1},
23163 {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous,
sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
23164 {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou,
sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
23165 {&__pyx_n_s_ndim, __pyx_k_ndim,
sizeof(__pyx_k_ndim), 0, 0, 1, 1},
23166 {&__pyx_n_s_new, __pyx_k_new,
sizeof(__pyx_k_new), 0, 0, 1, 1},
23167 {&__pyx_n_s_nl_gauss_seidel_NR_solve, __pyx_k_nl_gauss_seidel_NR_solve,
sizeof(__pyx_k_nl_gauss_seidel_NR_solve), 0, 0, 1, 1},
23168 {&__pyx_n_s_nl_jacobi_NR_solve, __pyx_k_nl_jacobi_NR_solve,
sizeof(__pyx_k_nl_jacobi_NR_solve), 0, 0, 1, 1},
23169 {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non,
sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
23170 {&__pyx_n_s_node_order, __pyx_k_node_order,
sizeof(__pyx_k_node_order), 0, 0, 1, 1},
23171 {&__pyx_n_s_np, __pyx_k_np,
sizeof(__pyx_k_np), 0, 0, 1, 1},
23172 {&__pyx_n_s_nr, __pyx_k_nr,
sizeof(__pyx_k_nr), 0, 0, 1, 1},
23173 {&__pyx_n_s_numpy, __pyx_k_numpy,
sizeof(__pyx_k_numpy), 0, 0, 1, 1},
23174 {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to,
sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
23175 {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor,
sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
23176 {&__pyx_n_s_obj, __pyx_k_obj,
sizeof(__pyx_k_obj), 0, 0, 1, 1},
23177 {&__pyx_n_s_object, __pyx_k_object,
sizeof(__pyx_k_object), 0, 0, 1, 1},
23178 {&__pyx_n_s_pack, __pyx_k_pack,
sizeof(__pyx_k_pack), 0, 0, 1, 1},
23179 {&__pyx_n_s_pickle, __pyx_k_pickle,
sizeof(__pyx_k_pickle), 0, 0, 1, 1},
23180 {&__pyx_n_s_prepare, __pyx_k_prepare,
sizeof(__pyx_k_prepare), 0, 0, 1, 1},
23181 {&__pyx_kp_s_proteus_csmoothers_pyx, __pyx_k_proteus_csmoothers_pyx,
sizeof(__pyx_k_proteus_csmoothers_pyx), 0, 0, 1, 0},
23182 {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError,
sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
23183 {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum,
sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
23184 {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer,
sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
23185 {&__pyx_n_s_pyx_result, __pyx_k_pyx_result,
sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
23186 {&__pyx_n_s_pyx_state, __pyx_k_pyx_state,
sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
23187 {&__pyx_n_s_pyx_type, __pyx_k_pyx_type,
sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
23188 {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum,
sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
23189 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable,
sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
23190 {&__pyx_n_s_qualname, __pyx_k_qualname,
sizeof(__pyx_k_qualname), 0, 0, 1, 1},
23191 {&__pyx_n_s_range, __pyx_k_range,
sizeof(__pyx_k_range), 0, 0, 1, 1},
23192 {&__pyx_n_s_reduce, __pyx_k_reduce,
sizeof(__pyx_k_reduce), 0, 0, 1, 1},
23193 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython,
sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
23194 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex,
sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
23195 {&__pyx_n_s_self, __pyx_k_self,
sizeof(__pyx_k_self), 0, 0, 1, 1},
23196 {&__pyx_n_s_setstate, __pyx_k_setstate,
sizeof(__pyx_k_setstate), 0, 0, 1, 1},
23197 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython,
sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
23198 {&__pyx_n_s_shape, __pyx_k_shape,
sizeof(__pyx_k_shape), 0, 0, 1, 1},
23199 {&__pyx_n_s_size, __pyx_k_size,
sizeof(__pyx_k_size), 0, 0, 1, 1},
23200 {&__pyx_n_s_start, __pyx_k_start,
sizeof(__pyx_k_start), 0, 0, 1, 1},
23201 {&__pyx_n_s_step, __pyx_k_step,
sizeof(__pyx_k_step), 0, 0, 1, 1},
23202 {&__pyx_n_s_stop, __pyx_k_stop,
sizeof(__pyx_k_stop), 0, 0, 1, 1},
23203 {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct,
sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
23204 {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect,
sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
23205 {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect,
sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
23206 {&__pyx_kp_s_stringsource, __pyx_k_stringsource,
sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
23207 {&__pyx_n_s_struct, __pyx_k_struct,
sizeof(__pyx_k_struct), 0, 0, 1, 1},
23208 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
23209 {&__pyx_n_s_tol, __pyx_k_tol,
sizeof(__pyx_k_tol), 0, 0, 1, 1},
23210 {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data,
sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
23211 {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str,
sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
23212 {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd,
sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
23213 {&__pyx_n_s_unpack, __pyx_k_unpack,
sizeof(__pyx_k_unpack), 0, 0, 1, 1},
23214 {&__pyx_n_s_update, __pyx_k_update,
sizeof(__pyx_k_update), 0, 0, 1, 1},
23215 {&__pyx_n_s_w, __pyx_k_w,
sizeof(__pyx_k_w), 0, 0, 1, 1},
23216 {0, 0, 0, 0, 0, 0, 0}
23218 static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(
void) {
23219 __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object);
if (!__pyx_builtin_object) __PYX_ERR(0, 5, __pyx_L1_error)
23220 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError);
if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
23221 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError);
if (!__pyx_builtin_ValueError) __PYX_ERR(2, 272, __pyx_L1_error)
23222 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_range) __PYX_ERR(2, 285, __pyx_L1_error)
23223 __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError);
if (!__pyx_builtin_RuntimeError) __PYX_ERR(2, 856, __pyx_L1_error)
23224 __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError);
if (!__pyx_builtin_ImportError) __PYX_ERR(2, 1038, __pyx_L1_error)
23225 __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError);
if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 148, __pyx_L1_error)
23226 __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate);
if (!__pyx_builtin_enumerate) __PYX_ERR(1, 151, __pyx_L1_error)
23227 __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis);
if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 404, __pyx_L1_error)
23228 __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id);
if (!__pyx_builtin_id) __PYX_ERR(1, 613, __pyx_L1_error)
23229 __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError);
if (!__pyx_builtin_IndexError) __PYX_ERR(1, 832, __pyx_L1_error)
23235 static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(
void) {
23236 __Pyx_RefNannyDeclarations
23237 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
23245 __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 2, __pyx_L1_error)
23246 __Pyx_GOTREF(__pyx_tuple_);
23247 __Pyx_GIVEREF(__pyx_tuple_);
23254 __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 4, __pyx_L1_error)
23255 __Pyx_GOTREF(__pyx_tuple__2);
23256 __Pyx_GIVEREF(__pyx_tuple__2);
23264 __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 2, __pyx_L1_error)
23265 __Pyx_GOTREF(__pyx_tuple__3);
23266 __Pyx_GIVEREF(__pyx_tuple__3);
23273 __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 4, __pyx_L1_error)
23274 __Pyx_GOTREF(__pyx_tuple__4);
23275 __Pyx_GIVEREF(__pyx_tuple__4);
23284 __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous);
if (unlikely(!__pyx_tuple__5)) __PYX_ERR(2, 272, __pyx_L1_error)
23285 __Pyx_GOTREF(__pyx_tuple__5);
23286 __Pyx_GIVEREF(__pyx_tuple__5);
23295 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou);
if (unlikely(!__pyx_tuple__6)) __PYX_ERR(2, 276, __pyx_L1_error)
23296 __Pyx_GOTREF(__pyx_tuple__6);
23297 __Pyx_GIVEREF(__pyx_tuple__6);
23306 __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor);
if (unlikely(!__pyx_tuple__7)) __PYX_ERR(2, 306, __pyx_L1_error)
23307 __Pyx_GOTREF(__pyx_tuple__7);
23308 __Pyx_GIVEREF(__pyx_tuple__7);
23317 __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor);
if (unlikely(!__pyx_tuple__8)) __PYX_ERR(2, 856, __pyx_L1_error)
23318 __Pyx_GOTREF(__pyx_tuple__8);
23319 __Pyx_GIVEREF(__pyx_tuple__8);
23328 __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2);
if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 880, __pyx_L1_error)
23329 __Pyx_GOTREF(__pyx_tuple__9);
23330 __Pyx_GIVEREF(__pyx_tuple__9);
23339 __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to);
if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 1038, __pyx_L1_error)
23340 __Pyx_GOTREF(__pyx_tuple__10);
23341 __Pyx_GIVEREF(__pyx_tuple__10);
23350 __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor);
if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 1044, __pyx_L1_error)
23351 __Pyx_GOTREF(__pyx_tuple__11);
23352 __Pyx_GIVEREF(__pyx_tuple__11);
23361 __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr);
if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 133, __pyx_L1_error)
23362 __Pyx_GOTREF(__pyx_tuple__12);
23363 __Pyx_GIVEREF(__pyx_tuple__12);
23372 __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array);
if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 136, __pyx_L1_error)
23373 __Pyx_GOTREF(__pyx_tuple__13);
23374 __Pyx_GIVEREF(__pyx_tuple__13);
23383 __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str);
if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 148, __pyx_L1_error)
23384 __Pyx_GOTREF(__pyx_tuple__14);
23385 __Pyx_GIVEREF(__pyx_tuple__14);
23394 __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data);
if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 176, __pyx_L1_error)
23395 __Pyx_GOTREF(__pyx_tuple__15);
23396 __Pyx_GIVEREF(__pyx_tuple__15);
23405 __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is);
if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 192, __pyx_L1_error)
23406 __Pyx_GOTREF(__pyx_tuple__16);
23407 __Pyx_GIVEREF(__pyx_tuple__16);
23415 __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 2, __pyx_L1_error)
23416 __Pyx_GOTREF(__pyx_tuple__17);
23417 __Pyx_GIVEREF(__pyx_tuple__17);
23424 __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 4, __pyx_L1_error)
23425 __Pyx_GOTREF(__pyx_tuple__18);
23426 __Pyx_GIVEREF(__pyx_tuple__18);
23435 __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor);
if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 418, __pyx_L1_error)
23436 __Pyx_GOTREF(__pyx_tuple__19);
23437 __Pyx_GIVEREF(__pyx_tuple__19);
23446 __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object);
if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 495, __pyx_L1_error)
23447 __Pyx_GOTREF(__pyx_tuple__20);
23448 __Pyx_GIVEREF(__pyx_tuple__20);
23457 __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi);
if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 520, __pyx_L1_error)
23458 __Pyx_GOTREF(__pyx_tuple__21);
23459 __Pyx_GIVEREF(__pyx_tuple__21);
23468 __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri);
if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 570, __pyx_L1_error)
23469 __Pyx_GOTREF(__pyx_tuple__22);
23470 __Pyx_GIVEREF(__pyx_tuple__22);
23479 __pyx_tuple__23 = PyTuple_New(1);
if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 577, __pyx_L1_error)
23480 __Pyx_GOTREF(__pyx_tuple__23);
23481 __Pyx_INCREF(__pyx_int_neg_1);
23482 __Pyx_GIVEREF(__pyx_int_neg_1);
23483 PyTuple_SET_ITEM(__pyx_tuple__23, 0, __pyx_int_neg_1);
23484 __Pyx_GIVEREF(__pyx_tuple__23);
23492 __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 2, __pyx_L1_error)
23493 __Pyx_GOTREF(__pyx_tuple__24);
23494 __Pyx_GIVEREF(__pyx_tuple__24);
23501 __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 4, __pyx_L1_error)
23502 __Pyx_GOTREF(__pyx_tuple__25);
23503 __Pyx_GIVEREF(__pyx_tuple__25);
23512 __pyx_slice__26 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__26)) __PYX_ERR(1, 682, __pyx_L1_error)
23513 __Pyx_GOTREF(__pyx_slice__26);
23514 __Pyx_GIVEREF(__pyx_slice__26);
23523 __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte);
if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 703, __pyx_L1_error)
23524 __Pyx_GOTREF(__pyx_tuple__27);
23525 __Pyx_GIVEREF(__pyx_tuple__27);
23533 __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 2, __pyx_L1_error)
23534 __Pyx_GOTREF(__pyx_tuple__28);
23535 __Pyx_GIVEREF(__pyx_tuple__28);
23542 __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 4, __pyx_L1_error)
23543 __Pyx_GOTREF(__pyx_tuple__29);
23544 __Pyx_GIVEREF(__pyx_tuple__29);
23553 __pyx_tuple__30 = PyTuple_Pack(1, __pyx_builtin_object);
if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 5, __pyx_L1_error)
23554 __Pyx_GOTREF(__pyx_tuple__30);
23555 __Pyx_GIVEREF(__pyx_tuple__30);
23564 __pyx_tuple__31 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_L);
if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 7, __pyx_L1_error)
23565 __Pyx_GOTREF(__pyx_tuple__31);
23566 __Pyx_GIVEREF(__pyx_tuple__31);
23567 __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_init, 7, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 7, __pyx_L1_error)
23576 __pyx_tuple__33 = PyTuple_Pack(1, __pyx_builtin_object);
if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 42, __pyx_L1_error)
23577 __Pyx_GOTREF(__pyx_tuple__33);
23578 __Pyx_GIVEREF(__pyx_tuple__33);
23587 __pyx_tuple__34 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_L, __pyx_n_s_bs);
if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 44, __pyx_L1_error)
23588 __Pyx_GOTREF(__pyx_tuple__34);
23589 __Pyx_GIVEREF(__pyx_tuple__34);
23590 __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_init, 44, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 44, __pyx_L1_error)
23599 __pyx_tuple__36 = PyTuple_Pack(4, __pyx_n_s_A, __pyx_n_s_w, __pyx_n_s_tol, __pyx_n_s_M);
if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 84, __pyx_L1_error)
23600 __Pyx_GOTREF(__pyx_tuple__36);
23601 __Pyx_GIVEREF(__pyx_tuple__36);
23602 __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_jacobi_NR_prepare, 84, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 84, __pyx_L1_error)
23611 __pyx_tuple__38 = PyTuple_Pack(5, __pyx_n_s_A, __pyx_n_s_M, __pyx_n_s_R, __pyx_n_s_node_order, __pyx_n_s_dX);
if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 109, __pyx_L1_error)
23612 __Pyx_GOTREF(__pyx_tuple__38);
23613 __Pyx_GIVEREF(__pyx_tuple__38);
23614 __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_jacobi_NR_solve, 109, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 109, __pyx_L1_error)
23623 __pyx_tuple__40 = PyTuple_Pack(6, __pyx_n_s_A, __pyx_n_s_R, __pyx_n_s_node_order, __pyx_n_s_w, __pyx_n_s_tol, __pyx_n_s_dX);
if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 136, __pyx_L1_error)
23624 __Pyx_GOTREF(__pyx_tuple__40);
23625 __Pyx_GIVEREF(__pyx_tuple__40);
23626 __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_nl_jacobi_NR_solve, 136, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 136, __pyx_L1_error)
23635 __pyx_tuple__42 = PyTuple_Pack(4, __pyx_n_s_A, __pyx_n_s_w, __pyx_n_s_tol, __pyx_n_s_M);
if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 165, __pyx_L1_error)
23636 __Pyx_GOTREF(__pyx_tuple__42);
23637 __Pyx_GIVEREF(__pyx_tuple__42);
23638 __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_gauss_seidel_NR_preare, 165, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 165, __pyx_L1_error)
23647 __pyx_tuple__44 = PyTuple_Pack(5, __pyx_n_s_A, __pyx_n_s_M, __pyx_n_s_R, __pyx_n_s_node_order, __pyx_n_s_dX);
if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 190, __pyx_L1_error)
23648 __Pyx_GOTREF(__pyx_tuple__44);
23649 __Pyx_GIVEREF(__pyx_tuple__44);
23650 __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_gauss_seidel_NR_solve, 190, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 190, __pyx_L1_error)
23659 __pyx_tuple__46 = PyTuple_Pack(6, __pyx_n_s_A, __pyx_n_s_R, __pyx_n_s_node_order, __pyx_n_s_w, __pyx_n_s_tol, __pyx_n_s_dX);
if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 217, __pyx_L1_error)
23660 __Pyx_GOTREF(__pyx_tuple__46);
23661 __Pyx_GIVEREF(__pyx_tuple__46);
23662 __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_nl_gauss_seidel_NR_solve, 217, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 217, __pyx_L1_error)
23671 __pyx_tuple__48 = PyTuple_Pack(2, __pyx_n_s_A, __pyx_n_s_asmFactor);
if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 251, __pyx_L1_error)
23672 __Pyx_GOTREF(__pyx_tuple__48);
23673 __Pyx_GIVEREF(__pyx_tuple__48);
23674 __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_asm_NR_prepare, 251, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 251, __pyx_L1_error)
23683 __pyx_tuple__50 = PyTuple_Pack(6, __pyx_n_s_A, __pyx_n_s_w, __pyx_n_s_asmFactor, __pyx_n_s_node_order, __pyx_n_s_R, __pyx_n_s_dX);
if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 277, __pyx_L1_error)
23684 __Pyx_GOTREF(__pyx_tuple__50);
23685 __Pyx_GIVEREF(__pyx_tuple__50);
23686 __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_asm_NR_solve, 277, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 277, __pyx_L1_error)
23695 __pyx_tuple__52 = PyTuple_Pack(2, __pyx_n_s_A, __pyx_n_s_basmFactor);
if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 321, __pyx_L1_error)
23696 __Pyx_GOTREF(__pyx_tuple__52);
23697 __Pyx_GIVEREF(__pyx_tuple__52);
23698 __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_basm_NR_prepare, 321, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 321, __pyx_L1_error)
23707 __pyx_tuple__54 = PyTuple_Pack(6, __pyx_n_s_A, __pyx_n_s_w, __pyx_n_s_basmFactor, __pyx_n_s_node_order, __pyx_n_s_R, __pyx_n_s_dX);
if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 350, __pyx_L1_error)
23708 __Pyx_GOTREF(__pyx_tuple__54);
23709 __Pyx_GIVEREF(__pyx_tuple__54);
23710 __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_basm_NR_solve, 350, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 350, __pyx_L1_error)
23719 __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect);
if (unlikely(!__pyx_tuple__56)) __PYX_ERR(1, 286, __pyx_L1_error)
23720 __Pyx_GOTREF(__pyx_tuple__56);
23721 __Pyx_GIVEREF(__pyx_tuple__56);
23730 __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct);
if (unlikely(!__pyx_tuple__57)) __PYX_ERR(1, 287, __pyx_L1_error)
23731 __Pyx_GOTREF(__pyx_tuple__57);
23732 __Pyx_GIVEREF(__pyx_tuple__57);
23741 __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect);
if (unlikely(!__pyx_tuple__58)) __PYX_ERR(1, 288, __pyx_L1_error)
23742 __Pyx_GOTREF(__pyx_tuple__58);
23743 __Pyx_GIVEREF(__pyx_tuple__58);
23752 __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct);
if (unlikely(!__pyx_tuple__59)) __PYX_ERR(1, 291, __pyx_L1_error)
23753 __Pyx_GOTREF(__pyx_tuple__59);
23754 __Pyx_GIVEREF(__pyx_tuple__59);
23763 __pyx_tuple__60 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect);
if (unlikely(!__pyx_tuple__60)) __PYX_ERR(1, 292, __pyx_L1_error)
23764 __Pyx_GOTREF(__pyx_tuple__60);
23765 __Pyx_GIVEREF(__pyx_tuple__60);
23772 __pyx_tuple__61 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result);
if (unlikely(!__pyx_tuple__61)) __PYX_ERR(1, 1, __pyx_L1_error)
23773 __Pyx_GOTREF(__pyx_tuple__61);
23774 __Pyx_GIVEREF(__pyx_tuple__61);
23775 __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(1, 1, __pyx_L1_error)
23776 __Pyx_RefNannyFinishContext();
23779 __Pyx_RefNannyFinishContext();
23783 static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void) {
23784 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23785 __pyx_int_0 = PyInt_FromLong(0);
if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
23786 __pyx_int_1 = PyInt_FromLong(1);
if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23787 __pyx_int_184977713 = PyInt_FromLong(184977713
L);
if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
23788 __pyx_int_neg_1 = PyInt_FromLong(-1);
if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23794 static CYTHON_SMALL_CODE
int __Pyx_modinit_global_init_code(
void);
23795 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_export_code(
void);
23796 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_export_code(
void);
23797 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_init_code(
void);
23798 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_import_code(
void);
23799 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_import_code(
void);
23800 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_import_code(
void);
23802 static int __Pyx_modinit_global_init_code(
void) {
23803 __Pyx_RefNannyDeclarations
23804 __Pyx_RefNannySetupContext(
"__Pyx_modinit_global_init_code", 0);
23806 generic = Py_None; Py_INCREF(Py_None);
23807 strided = Py_None; Py_INCREF(Py_None);
23808 indirect = Py_None; Py_INCREF(Py_None);
23809 contiguous = Py_None; Py_INCREF(Py_None);
23810 indirect_contiguous = Py_None; Py_INCREF(Py_None);
23811 __Pyx_RefNannyFinishContext();
23815 static int __Pyx_modinit_variable_export_code(
void) {
23816 __Pyx_RefNannyDeclarations
23817 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_export_code", 0);
23819 __Pyx_RefNannyFinishContext();
23823 static int __Pyx_modinit_function_export_code(
void) {
23824 __Pyx_RefNannyDeclarations
23825 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_export_code", 0);
23827 __Pyx_RefNannyFinishContext();
23831 static int __Pyx_modinit_type_init_code(
void) {
23832 __Pyx_RefNannyDeclarations
23833 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_init_code", 0);
23835 if (PyType_Ready(&__pyx_type_10csmoothers_cASMFactor) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
23836 #if PY_VERSION_HEX < 0x030800B1 23837 __pyx_type_10csmoothers_cASMFactor.tp_print = 0;
23839 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10csmoothers_cASMFactor.tp_dictoffset && __pyx_type_10csmoothers_cASMFactor.tp_getattro == PyObject_GenericGetAttr)) {
23840 __pyx_type_10csmoothers_cASMFactor.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23842 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_cASMFactor_2, (PyObject *)&__pyx_type_10csmoothers_cASMFactor) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
23843 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_10csmoothers_cASMFactor) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
23844 __pyx_ptype_10csmoothers_cASMFactor = &__pyx_type_10csmoothers_cASMFactor;
23845 if (PyType_Ready(&__pyx_type_10csmoothers_cBASMFactor) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
23846 #if PY_VERSION_HEX < 0x030800B1 23847 __pyx_type_10csmoothers_cBASMFactor.tp_print = 0;
23849 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10csmoothers_cBASMFactor.tp_dictoffset && __pyx_type_10csmoothers_cBASMFactor.tp_getattro == PyObject_GenericGetAttr)) {
23850 __pyx_type_10csmoothers_cBASMFactor.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23852 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_cBASMFactor_2, (PyObject *)&__pyx_type_10csmoothers_cBASMFactor) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
23853 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_10csmoothers_cBASMFactor) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
23854 __pyx_ptype_10csmoothers_cBASMFactor = &__pyx_type_10csmoothers_cBASMFactor;
23855 __pyx_vtabptr_array = &__pyx_vtable_array;
23856 __pyx_vtable_array.get_memview = (PyObject *(*)(
struct __pyx_array_obj *))__pyx_array_get_memview;
23857 if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
23858 #if PY_VERSION_HEX < 0x030800B1 23859 __pyx_type___pyx_array.tp_print = 0;
23861 if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
23862 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
23863 __pyx_array_type = &__pyx_type___pyx_array;
23864 if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
23865 #if PY_VERSION_HEX < 0x030800B1 23866 __pyx_type___pyx_MemviewEnum.tp_print = 0;
23868 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
23869 __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23871 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
23872 __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
23873 __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
23874 __pyx_vtable_memoryview.get_item_pointer = (
char *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
23875 __pyx_vtable_memoryview.is_slice = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
23876 __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
23877 __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
23878 __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
23879 __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryview_convert_item_to_object;
23880 __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryview_assign_item_from_object;
23881 if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
23882 #if PY_VERSION_HEX < 0x030800B1 23883 __pyx_type___pyx_memoryview.tp_print = 0;
23885 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
23886 __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23888 if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
23889 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
23890 __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
23891 __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
23892 __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
23893 __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryviewslice_convert_item_to_object;
23894 __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
23895 __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
23896 if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
23897 #if PY_VERSION_HEX < 0x030800B1 23898 __pyx_type___pyx_memoryviewslice.tp_print = 0;
23900 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
23901 __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23903 if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
23904 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
23905 __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
23906 __Pyx_RefNannyFinishContext();
23909 __Pyx_RefNannyFinishContext();
23913 static int __Pyx_modinit_type_import_code(
void) {
23914 __Pyx_RefNannyDeclarations
23915 PyObject *__pyx_t_1 = NULL;
23916 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_import_code", 0);
23918 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
23919 __Pyx_GOTREF(__pyx_t_1);
23920 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME,
"type",
23921 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
23922 sizeof(PyTypeObject),
23924 sizeof(PyHeapTypeObject),
23926 __Pyx_ImportType_CheckSize_Warn);
23927 if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
23928 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23929 __pyx_t_1 = PyImport_ImportModule(
"numpy");
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 206, __pyx_L1_error)
23930 __Pyx_GOTREF(__pyx_t_1);
23931 __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1,
"numpy",
"dtype",
sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
23932 if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 206, __pyx_L1_error)
23933 __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1,
"numpy",
"flatiter",
sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Warn);
23934 if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 229, __pyx_L1_error)
23935 __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1,
"numpy",
"broadcast",
sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Warn);
23936 if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 233, __pyx_L1_error)
23937 __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1,
"numpy",
"ndarray",
sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
23938 if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 242, __pyx_L1_error)
23939 __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1,
"numpy",
"ufunc",
sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Warn);
23940 if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 918, __pyx_L1_error)
23941 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23942 __pyx_t_1 = PyImport_ImportModule(
"proteus.superluWrappers");
if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 67, __pyx_L1_error)
23943 __Pyx_GOTREF(__pyx_t_1);
23944 __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix = __Pyx_ImportType(__pyx_t_1,
"proteus.superluWrappers",
"cSparseMatrix",
sizeof(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix), __Pyx_ImportType_CheckSize_Warn);
23945 if (!__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix) __PYX_ERR(4, 67, __pyx_L1_error)
23946 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23947 __Pyx_RefNannyFinishContext();
23950 __Pyx_XDECREF(__pyx_t_1);
23951 __Pyx_RefNannyFinishContext();
23955 static int __Pyx_modinit_variable_import_code(
void) {
23956 __Pyx_RefNannyDeclarations
23957 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_import_code", 0);
23959 __Pyx_RefNannyFinishContext();
23963 static int __Pyx_modinit_function_import_code(
void) {
23964 __Pyx_RefNannyDeclarations
23965 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_import_code", 0);
23967 __Pyx_RefNannyFinishContext();
23972 #if PY_MAJOR_VERSION < 3 23973 #ifdef CYTHON_NO_PYINIT_EXPORT 23974 #define __Pyx_PyMODINIT_FUNC void 23976 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC 23979 #ifdef CYTHON_NO_PYINIT_EXPORT 23980 #define __Pyx_PyMODINIT_FUNC PyObject * 23982 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC 23987 #if PY_MAJOR_VERSION < 3 23988 __Pyx_PyMODINIT_FUNC initcsmoothers(
void) CYTHON_SMALL_CODE;
23989 __Pyx_PyMODINIT_FUNC initcsmoothers(
void)
23991 __Pyx_PyMODINIT_FUNC PyInit_csmoothers(
void) CYTHON_SMALL_CODE;
23992 __Pyx_PyMODINIT_FUNC PyInit_csmoothers(
void)
23993 #if CYTHON_PEP489_MULTI_PHASE_INIT 23995 return PyModuleDef_Init(&__pyx_moduledef);
23997 static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(
void) {
23998 #if PY_VERSION_HEX >= 0x030700A1 23999 static PY_INT64_T main_interpreter_id = -1;
24000 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
24001 if (main_interpreter_id == -1) {
24002 main_interpreter_id = current_id;
24003 return (unlikely(current_id == -1)) ? -1 : 0;
24004 }
else if (unlikely(main_interpreter_id != current_id))
24006 static PyInterpreterState *main_interpreter = NULL;
24007 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
24008 if (!main_interpreter) {
24009 main_interpreter = current_interpreter;
24010 }
else if (unlikely(main_interpreter != current_interpreter))
24015 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
24020 static CYTHON_SMALL_CODE
int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict,
const char* from_name,
const char* to_name,
int allow_none) {
24021 PyObject *value = PyObject_GetAttrString(spec, from_name);
24023 if (likely(value)) {
24024 if (allow_none || value != Py_None) {
24025 result = PyDict_SetItemString(moddict, to_name, value);
24028 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
24035 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
24036 PyObject *module = NULL, *moddict, *modname;
24037 if (__Pyx_check_single_interpreter())
24040 return __Pyx_NewRef(__pyx_m);
24041 modname = PyObject_GetAttrString(spec,
"name");
24042 if (unlikely(!modname))
goto bad;
24043 module = PyModule_NewObject(modname);
24044 Py_DECREF(modname);
24045 if (unlikely(!module))
goto bad;
24046 moddict = PyModule_GetDict(module);
24047 if (unlikely(!moddict))
goto bad;
24048 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__", 1) < 0))
goto bad;
24049 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__", 1) < 0))
goto bad;
24050 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__", 1) < 0))
goto bad;
24051 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__", 0) < 0))
goto bad;
24054 Py_XDECREF(module);
24059 static CYTHON_SMALL_CODE
int __pyx_pymod_exec_csmoothers(PyObject *__pyx_pyinit_module)
24063 PyObject *__pyx_t_1 = NULL;
24064 PyObject *__pyx_t_2 = NULL;
24065 PyObject *__pyx_t_3 = NULL;
24066 static PyThread_type_lock __pyx_t_4[8];
24067 __Pyx_RefNannyDeclarations
24068 #if CYTHON_PEP489_MULTI_PHASE_INIT 24070 if (__pyx_m == __pyx_pyinit_module)
return 0;
24071 PyErr_SetString(PyExc_RuntimeError,
"Module 'csmoothers' has already been imported. Re-initialisation is not supported.");
24074 #elif PY_MAJOR_VERSION >= 3 24075 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
24077 #if CYTHON_REFNANNY 24078 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
24079 if (!__Pyx_RefNanny) {
24081 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
24082 if (!__Pyx_RefNanny)
24083 Py_FatalError(
"failed to import 'refnanny' module");
24086 __Pyx_RefNannySetupContext(
"__Pyx_PyMODINIT_FUNC PyInit_csmoothers(void)", 0);
24087 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24088 #ifdef __Pxy_PyFrame_Initialize_Offsets 24089 __Pxy_PyFrame_Initialize_Offsets();
24091 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
24092 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
24093 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
24094 #ifdef __Pyx_CyFunction_USED 24095 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24097 #ifdef __Pyx_FusedFunction_USED 24098 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24100 #ifdef __Pyx_Coroutine_USED 24101 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24103 #ifdef __Pyx_Generator_USED 24104 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24106 #ifdef __Pyx_AsyncGen_USED 24107 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24109 #ifdef __Pyx_StopAsyncIteration_USED 24110 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24114 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS 24116 PyEval_InitThreads();
24120 #if CYTHON_PEP489_MULTI_PHASE_INIT 24121 __pyx_m = __pyx_pyinit_module;
24122 Py_INCREF(__pyx_m);
24124 #if PY_MAJOR_VERSION < 3 24125 __pyx_m = Py_InitModule4(
"csmoothers", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
24127 __pyx_m = PyModule_Create(&__pyx_moduledef);
24129 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
24131 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
24132 Py_INCREF(__pyx_d);
24133 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
24134 Py_INCREF(__pyx_b);
24135 __pyx_cython_runtime = PyImport_AddModule((
char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
24136 Py_INCREF(__pyx_cython_runtime);
24137 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
24139 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24140 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) 24141 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24143 if (__pyx_module_is_main_csmoothers) {
24144 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24146 #if PY_MAJOR_VERSION >= 3 24148 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
24149 if (!PyDict_GetItemString(modules,
"csmoothers")) {
24150 if (unlikely(PyDict_SetItemString(modules,
"csmoothers", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
24155 if (__Pyx_InitCachedBuiltins() < 0)
goto __pyx_L1_error;
24157 if (__Pyx_InitCachedConstants() < 0)
goto __pyx_L1_error;
24159 (void)__Pyx_modinit_global_init_code();
24160 (void)__Pyx_modinit_variable_export_code();
24161 (void)__Pyx_modinit_function_export_code();
24162 if (unlikely(__Pyx_modinit_type_init_code() != 0))
goto __pyx_L1_error;
24163 if (unlikely(__Pyx_modinit_type_import_code() != 0))
goto __pyx_L1_error;
24164 (void)__Pyx_modinit_variable_import_code();
24165 (void)__Pyx_modinit_function_import_code();
24167 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) 24168 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24176 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
24177 __Pyx_GOTREF(__pyx_t_1);
24178 if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24179 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24188 __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__30);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error)
24189 __Pyx_GOTREF(__pyx_t_1);
24190 __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__30, __pyx_n_s_ASMFactor, __pyx_n_s_ASMFactor, (PyObject *) NULL, __pyx_n_s_csmoothers, (PyObject *) NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error)
24191 __Pyx_GOTREF(__pyx_t_2);
24200 __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10csmoothers_9ASMFactor_1__init__, 0, __pyx_n_s_ASMFactor___init, NULL, __pyx_n_s_csmoothers, __pyx_d, ((PyObject *)__pyx_codeobj__32));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error)
24201 __Pyx_GOTREF(__pyx_t_3);
24202 if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error)
24203 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24212 __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ASMFactor, __pyx_tuple__30, __pyx_t_2, NULL, 0, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error)
24213 __Pyx_GOTREF(__pyx_t_3);
24214 if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASMFactor, __pyx_t_3) < 0) __PYX_ERR(0, 5, __pyx_L1_error)
24215 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24216 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24217 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24226 __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__33);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error)
24227 __Pyx_GOTREF(__pyx_t_1);
24228 __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__33, __pyx_n_s_BASMFactor, __pyx_n_s_BASMFactor, (PyObject *) NULL, __pyx_n_s_csmoothers, (PyObject *) NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
24229 __Pyx_GOTREF(__pyx_t_2);
24238 __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10csmoothers_10BASMFactor_1__init__, 0, __pyx_n_s_BASMFactor___init, NULL, __pyx_n_s_csmoothers, __pyx_d, ((PyObject *)__pyx_codeobj__35));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error)
24239 __Pyx_GOTREF(__pyx_t_3);
24240 if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 44, __pyx_L1_error)
24241 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24250 __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_BASMFactor, __pyx_tuple__33, __pyx_t_2, NULL, 0, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error)
24251 __Pyx_GOTREF(__pyx_t_3);
24252 if (PyDict_SetItem(__pyx_d, __pyx_n_s_BASMFactor, __pyx_t_3) < 0) __PYX_ERR(0, 42, __pyx_L1_error)
24253 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24254 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24255 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24264 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_1jacobi_NR_prepare, NULL, __pyx_n_s_csmoothers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
24265 __Pyx_GOTREF(__pyx_t_1);
24266 if (PyDict_SetItem(__pyx_d, __pyx_n_s_jacobi_NR_prepare, __pyx_t_1) < 0) __PYX_ERR(0, 84, __pyx_L1_error)
24267 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24276 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_3jacobi_NR_solve, NULL, __pyx_n_s_csmoothers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error)
24277 __Pyx_GOTREF(__pyx_t_1);
24278 if (PyDict_SetItem(__pyx_d, __pyx_n_s_jacobi_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
24279 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24288 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_5nl_jacobi_NR_solve, NULL, __pyx_n_s_csmoothers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error)
24289 __Pyx_GOTREF(__pyx_t_1);
24290 if (PyDict_SetItem(__pyx_d, __pyx_n_s_nl_jacobi_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 136, __pyx_L1_error)
24291 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24300 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_7gauss_seidel_NR_preare, NULL, __pyx_n_s_csmoothers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
24301 __Pyx_GOTREF(__pyx_t_1);
24302 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gauss_seidel_NR_preare, __pyx_t_1) < 0) __PYX_ERR(0, 165, __pyx_L1_error)
24303 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24312 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_9gauss_seidel_NR_solve, NULL, __pyx_n_s_csmoothers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error)
24313 __Pyx_GOTREF(__pyx_t_1);
24314 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gauss_seidel_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 190, __pyx_L1_error)
24315 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24324 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_11nl_gauss_seidel_NR_solve, NULL, __pyx_n_s_csmoothers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error)
24325 __Pyx_GOTREF(__pyx_t_1);
24326 if (PyDict_SetItem(__pyx_d, __pyx_n_s_nl_gauss_seidel_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 217, __pyx_L1_error)
24327 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24336 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_13asm_NR_prepare, NULL, __pyx_n_s_csmoothers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 251, __pyx_L1_error)
24337 __Pyx_GOTREF(__pyx_t_1);
24338 if (PyDict_SetItem(__pyx_d, __pyx_n_s_asm_NR_prepare, __pyx_t_1) < 0) __PYX_ERR(0, 251, __pyx_L1_error)
24339 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24348 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_15asm_NR_solve, NULL, __pyx_n_s_csmoothers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error)
24349 __Pyx_GOTREF(__pyx_t_1);
24350 if (PyDict_SetItem(__pyx_d, __pyx_n_s_asm_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 277, __pyx_L1_error)
24351 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24360 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_17basm_NR_prepare, NULL, __pyx_n_s_csmoothers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 321, __pyx_L1_error)
24361 __Pyx_GOTREF(__pyx_t_1);
24362 if (PyDict_SetItem(__pyx_d, __pyx_n_s_basm_NR_prepare, __pyx_t_1) < 0) __PYX_ERR(0, 321, __pyx_L1_error)
24363 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24372 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_19basm_NR_solve, NULL, __pyx_n_s_csmoothers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 350, __pyx_L1_error)
24373 __Pyx_GOTREF(__pyx_t_1);
24374 if (PyDict_SetItem(__pyx_d, __pyx_n_s_basm_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 350, __pyx_L1_error)
24375 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24382 __pyx_t_1 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
24383 __Pyx_GOTREF(__pyx_t_1);
24384 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24385 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24394 __pyx_t_1 = __pyx_capsule_create(((
void *)(&__pyx_array_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 209, __pyx_L1_error)
24395 __Pyx_GOTREF(__pyx_t_1);
24396 if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 209, __pyx_L1_error)
24397 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24398 PyType_Modified(__pyx_array_type);
24407 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__56, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 286, __pyx_L1_error)
24408 __Pyx_GOTREF(__pyx_t_1);
24409 __Pyx_XGOTREF(
generic);
24410 __Pyx_DECREF_SET(
generic, __pyx_t_1);
24411 __Pyx_GIVEREF(__pyx_t_1);
24421 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__57, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error)
24422 __Pyx_GOTREF(__pyx_t_1);
24423 __Pyx_XGOTREF(strided);
24424 __Pyx_DECREF_SET(strided, __pyx_t_1);
24425 __Pyx_GIVEREF(__pyx_t_1);
24435 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__58, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 288, __pyx_L1_error)
24436 __Pyx_GOTREF(__pyx_t_1);
24437 __Pyx_XGOTREF(indirect);
24438 __Pyx_DECREF_SET(indirect, __pyx_t_1);
24439 __Pyx_GIVEREF(__pyx_t_1);
24449 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__59, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 291, __pyx_L1_error)
24450 __Pyx_GOTREF(__pyx_t_1);
24451 __Pyx_XGOTREF(contiguous);
24452 __Pyx_DECREF_SET(contiguous, __pyx_t_1);
24453 __Pyx_GIVEREF(__pyx_t_1);
24463 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__60, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 292, __pyx_L1_error)
24464 __Pyx_GOTREF(__pyx_t_1);
24465 __Pyx_XGOTREF(indirect_contiguous);
24466 __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
24467 __Pyx_GIVEREF(__pyx_t_1);
24477 __pyx_memoryview_thread_locks_used = 0;
24486 __pyx_t_4[0] = PyThread_allocate_lock();
24487 __pyx_t_4[1] = PyThread_allocate_lock();
24488 __pyx_t_4[2] = PyThread_allocate_lock();
24489 __pyx_t_4[3] = PyThread_allocate_lock();
24490 __pyx_t_4[4] = PyThread_allocate_lock();
24491 __pyx_t_4[5] = PyThread_allocate_lock();
24492 __pyx_t_4[6] = PyThread_allocate_lock();
24493 __pyx_t_4[7] = PyThread_allocate_lock();
24494 memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_4,
sizeof(__pyx_memoryview_thread_locks[0]) * (8));
24503 __pyx_t_1 = __pyx_capsule_create(((
void *)(&__pyx_memoryview_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 549, __pyx_L1_error)
24504 __Pyx_GOTREF(__pyx_t_1);
24505 if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 549, __pyx_L1_error)
24506 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24507 PyType_Modified(__pyx_memoryview_type);
24516 __pyx_t_1 = __pyx_capsule_create(((
void *)(&__pyx_memoryview_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 995, __pyx_L1_error)
24517 __Pyx_GOTREF(__pyx_t_1);
24518 if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 995, __pyx_L1_error)
24519 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24520 PyType_Modified(__pyx_memoryviewslice_type);
24527 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
24528 __Pyx_GOTREF(__pyx_t_1);
24529 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
24530 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24544 __Pyx_XDECREF(__pyx_t_1);
24545 __Pyx_XDECREF(__pyx_t_2);
24546 __Pyx_XDECREF(__pyx_t_3);
24549 __Pyx_AddTraceback(
"init csmoothers", __pyx_clineno, __pyx_lineno, __pyx_filename);
24552 }
else if (!PyErr_Occurred()) {
24553 PyErr_SetString(PyExc_ImportError,
"init csmoothers");
24556 __Pyx_RefNannyFinishContext();
24557 #if CYTHON_PEP489_MULTI_PHASE_INIT 24558 return (__pyx_m != NULL) ? 0 : -1;
24559 #elif PY_MAJOR_VERSION >= 3 24568 #if CYTHON_REFNANNY 24569 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
24570 PyObject *m = NULL, *p = NULL;
24572 m = PyImport_ImportModule(modname);
24574 p = PyObject_GetAttrString(m,
"RefNannyAPI");
24576 r = PyLong_AsVoidPtr(p);
24580 return (__Pyx_RefNannyAPIStruct *)
r;
24585 #if CYTHON_USE_TYPE_SLOTS 24586 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
24587 PyTypeObject* tp = Py_TYPE(obj);
24588 if (likely(tp->tp_getattro))
24589 return tp->tp_getattro(obj, attr_name);
24590 #if PY_MAJOR_VERSION < 3 24591 if (likely(tp->tp_getattr))
24592 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
24594 return PyObject_GetAttr(obj, attr_name);
24599 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
24600 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
24601 if (unlikely(!result)) {
24602 PyErr_Format(PyExc_NameError,
24603 #
if PY_MAJOR_VERSION >= 3
24604 "name '%U' is not defined", name);
24606 "name '%.200s' is not defined", PyString_AS_STRING(name));
24613 static void __Pyx_RaiseArgtupleInvalid(
24614 const char* func_name,
24616 Py_ssize_t num_min,
24617 Py_ssize_t num_max,
24618 Py_ssize_t num_found)
24620 Py_ssize_t num_expected;
24621 const char *more_or_less;
24622 if (num_found < num_min) {
24623 num_expected = num_min;
24624 more_or_less =
"at least";
24626 num_expected = num_max;
24627 more_or_less =
"at most";
24630 more_or_less =
"exactly";
24632 PyErr_Format(PyExc_TypeError,
24633 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
24634 func_name, more_or_less, num_expected,
24635 (num_expected == 1) ?
"" :
"s", num_found);
24639 static void __Pyx_RaiseDoubleKeywordsError(
24640 const char* func_name,
24643 PyErr_Format(PyExc_TypeError,
24644 #
if PY_MAJOR_VERSION >= 3
24645 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
24647 "%s() got multiple values for keyword argument '%s'", func_name,
24648 PyString_AsString(kw_name));
24653 static int __Pyx_ParseOptionalKeywords(
24655 PyObject **argnames[],
24657 PyObject *values[],
24658 Py_ssize_t num_pos_args,
24659 const char* function_name)
24661 PyObject *key = 0, *value = 0;
24662 Py_ssize_t
pos = 0;
24664 PyObject*** first_kw_arg = argnames + num_pos_args;
24665 while (PyDict_Next(kwds, &pos, &key, &value)) {
24666 name = first_kw_arg;
24667 while (*name && (**name != key)) name++;
24669 values[name-argnames] = value;
24672 name = first_kw_arg;
24673 #if PY_MAJOR_VERSION < 3 24674 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
24676 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
24677 && _PyString_Eq(**name, key)) {
24678 values[name-argnames] = value;
24683 if (*name)
continue;
24685 PyObject*** argname = argnames;
24686 while (argname != first_kw_arg) {
24687 if ((**argname == key) || (
24688 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
24689 && _PyString_Eq(**argname, key))) {
24690 goto arg_passed_twice;
24697 if (likely(PyUnicode_Check(key))) {
24699 int cmp = (**name == key) ? 0 :
24700 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
24701 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
24703 PyUnicode_Compare(**name, key);
24704 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
24706 values[name-argnames] = value;
24711 if (*name)
continue;
24713 PyObject*** argname = argnames;
24714 while (argname != first_kw_arg) {
24715 int cmp = (**argname == key) ? 0 :
24716 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
24717 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
24719 PyUnicode_Compare(**argname, key);
24720 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
24721 if (cmp == 0)
goto arg_passed_twice;
24726 goto invalid_keyword_type;
24728 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
24730 goto invalid_keyword;
24735 __Pyx_RaiseDoubleKeywordsError(function_name, key);
24737 invalid_keyword_type:
24738 PyErr_Format(PyExc_TypeError,
24739 "%.200s() keywords must be strings", function_name);
24742 PyErr_Format(PyExc_TypeError,
24743 #
if PY_MAJOR_VERSION < 3
24744 "%.200s() got an unexpected keyword argument '%.200s'",
24745 function_name, PyString_AsString(key));
24747 "%s() got an unexpected keyword argument '%U'",
24748 function_name, key);
24755 #if CYTHON_USE_TYPE_SLOTS 24756 static CYTHON_INLINE
int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
24757 PyTypeObject* tp = Py_TYPE(obj);
24758 if (likely(tp->tp_setattro))
24759 return tp->tp_setattro(obj, attr_name, value);
24760 #if PY_MAJOR_VERSION < 3 24761 if (likely(tp->tp_setattr))
24762 return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
24764 return PyObject_SetAttr(obj, attr_name, value);
24769 #if CYTHON_FAST_PYCCALL 24770 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
24771 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
24772 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
24773 PyObject *
self = PyCFunction_GET_SELF(func);
24774 int flags = PyCFunction_GET_FLAGS(func);
24775 assert(PyCFunction_Check(func));
24776 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
24777 assert(nargs >= 0);
24778 assert(nargs == 0 || args != NULL);
24782 assert(!PyErr_Occurred());
24783 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
24784 return (*((__Pyx_PyCFunctionFastWithKeywords)(
void*)meth)) (
self, args, nargs, NULL);
24786 return (*((__Pyx_PyCFunctionFast)(
void*)meth)) (
self, args, nargs);
24792 #if CYTHON_FAST_PYCALL 24793 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
24794 PyObject *globals) {
24796 PyThreadState *tstate = __Pyx_PyThreadState_Current;
24797 PyObject **fastlocals;
24800 assert(globals != NULL);
24805 assert(tstate != NULL);
24806 f = PyFrame_New(tstate, co, globals, NULL);
24810 fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
24811 for (i = 0; i < na; i++) {
24813 fastlocals[i] = *args++;
24815 result = PyEval_EvalFrameEx(f,0);
24816 ++tstate->recursion_depth;
24818 --tstate->recursion_depth;
24821 #if 1 || PY_VERSION_HEX < 0x030600B1 24822 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
24823 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
24824 PyObject *globals = PyFunction_GET_GLOBALS(func);
24825 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
24827 #if PY_MAJOR_VERSION >= 3 24830 PyObject *kwtuple, **k;
24835 assert(kwargs == NULL || PyDict_Check(kwargs));
24836 nk = kwargs ? PyDict_Size(kwargs) : 0;
24837 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
24841 #
if PY_MAJOR_VERSION >= 3
24842 co->co_kwonlyargcount == 0 &&
24844 likely(kwargs == NULL || nk == 0) &&
24845 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
24846 if (argdefs == NULL && co->co_argcount == nargs) {
24847 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
24850 else if (nargs == 0 && argdefs != NULL
24851 && co->co_argcount == Py_SIZE(argdefs)) {
24854 args = &PyTuple_GET_ITEM(argdefs, 0);
24855 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
24859 if (kwargs != NULL) {
24861 kwtuple = PyTuple_New(2 * nk);
24862 if (kwtuple == NULL) {
24866 k = &PyTuple_GET_ITEM(kwtuple, 0);
24868 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
24879 closure = PyFunction_GET_CLOSURE(func);
24880 #if PY_MAJOR_VERSION >= 3 24881 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
24883 if (argdefs != NULL) {
24884 d = &PyTuple_GET_ITEM(argdefs, 0);
24885 nd = Py_SIZE(argdefs);
24891 #if PY_MAJOR_VERSION >= 3 24892 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
24895 d, (
int)nd, kwdefs, closure);
24897 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
24900 d, (
int)nd, closure);
24902 Py_XDECREF(kwtuple);
24904 Py_LeaveRecursiveCall();
24911 #if CYTHON_COMPILING_IN_CPYTHON 24912 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
24914 ternaryfunc call = func->ob_type->tp_call;
24915 if (unlikely(!call))
24916 return PyObject_Call(func, arg, kw);
24917 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
24919 result = (*call)(func, arg, kw);
24920 Py_LeaveRecursiveCall();
24921 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24924 "NULL result without error in PyObject_Call");
24931 #if CYTHON_COMPILING_IN_CPYTHON 24932 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
24933 PyObject *
self, *result;
24935 cfunc = PyCFunction_GET_FUNCTION(func);
24936 self = PyCFunction_GET_SELF(func);
24937 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
24939 result = cfunc(
self, arg);
24940 Py_LeaveRecursiveCall();
24941 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24944 "NULL result without error in PyObject_Call");
24951 #if CYTHON_COMPILING_IN_CPYTHON 24952 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24954 PyObject *args = PyTuple_New(1);
24955 if (unlikely(!args))
return NULL;
24957 PyTuple_SET_ITEM(args, 0, arg);
24958 result = __Pyx_PyObject_Call(func, args, NULL);
24962 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24963 #if CYTHON_FAST_PYCALL 24964 if (PyFunction_Check(func)) {
24965 return __Pyx_PyFunction_FastCall(func, &arg, 1);
24968 if (likely(PyCFunction_Check(func))) {
24969 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
24970 return __Pyx_PyObject_CallMethO(func, arg);
24971 #if CYTHON_FAST_PYCCALL 24972 }
else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
24973 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
24977 return __Pyx__PyObject_CallOneArg(func, arg);
24980 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24982 PyObject *args = PyTuple_Pack(1, arg);
24983 if (unlikely(!args))
return NULL;
24984 result = __Pyx_PyObject_Call(func, args, NULL);
24991 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact)
24993 if (unlikely(!type)) {
24994 PyErr_SetString(PyExc_SystemError,
"Missing type object");
24998 #if PY_MAJOR_VERSION == 2 24999 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj)))
return 1;
25003 if (likely(__Pyx_TypeCheck(obj, type)))
return 1;
25005 PyErr_Format(PyExc_TypeError,
25006 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
25007 name, type->tp_name, Py_TYPE(obj)->tp_name);
25012 #if CYTHON_FAST_THREAD_STATE 25013 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
25014 PyObject *tmp_type, *tmp_value, *tmp_tb;
25015 tmp_type = tstate->curexc_type;
25016 tmp_value = tstate->curexc_value;
25017 tmp_tb = tstate->curexc_traceback;
25018 tstate->curexc_type = type;
25019 tstate->curexc_value = value;
25020 tstate->curexc_traceback = tb;
25021 Py_XDECREF(tmp_type);
25022 Py_XDECREF(tmp_value);
25023 Py_XDECREF(tmp_tb);
25025 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25026 *type = tstate->curexc_type;
25027 *value = tstate->curexc_value;
25028 *tb = tstate->curexc_traceback;
25029 tstate->curexc_type = 0;
25030 tstate->curexc_value = 0;
25031 tstate->curexc_traceback = 0;
25036 #if PY_MAJOR_VERSION < 3 25037 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
25038 CYTHON_UNUSED PyObject *cause) {
25039 __Pyx_PyThreadState_declare
25041 if (!value || value == Py_None)
25045 if (!tb || tb == Py_None)
25049 if (!PyTraceBack_Check(tb)) {
25050 PyErr_SetString(PyExc_TypeError,
25051 "raise: arg 3 must be a traceback or None");
25055 if (PyType_Check(type)) {
25056 #if CYTHON_COMPILING_IN_PYPY 25058 Py_INCREF(Py_None);
25062 PyErr_NormalizeException(&type, &value, &tb);
25065 PyErr_SetString(PyExc_TypeError,
25066 "instance exception may not have a separate value");
25070 type = (PyObject*) Py_TYPE(type);
25072 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
25073 PyErr_SetString(PyExc_TypeError,
25074 "raise: exception class must be a subclass of BaseException");
25078 __Pyx_PyThreadState_assign
25079 __Pyx_ErrRestore(type, value, tb);
25088 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
25089 PyObject* owned_instance = NULL;
25090 if (tb == Py_None) {
25092 }
else if (tb && !PyTraceBack_Check(tb)) {
25093 PyErr_SetString(PyExc_TypeError,
25094 "raise: arg 3 must be a traceback or None");
25097 if (value == Py_None)
25099 if (PyExceptionInstance_Check(type)) {
25101 PyErr_SetString(PyExc_TypeError,
25102 "instance exception may not have a separate value");
25106 type = (PyObject*) Py_TYPE(value);
25107 }
else if (PyExceptionClass_Check(type)) {
25108 PyObject *instance_class = NULL;
25109 if (value && PyExceptionInstance_Check(value)) {
25110 instance_class = (PyObject*) Py_TYPE(value);
25111 if (instance_class != type) {
25112 int is_subclass = PyObject_IsSubclass(instance_class, type);
25113 if (!is_subclass) {
25114 instance_class = NULL;
25115 }
else if (unlikely(is_subclass == -1)) {
25118 type = instance_class;
25122 if (!instance_class) {
25125 args = PyTuple_New(0);
25126 else if (PyTuple_Check(value)) {
25130 args = PyTuple_Pack(1, value);
25133 owned_instance = PyObject_Call(type, args, NULL);
25135 if (!owned_instance)
25137 value = owned_instance;
25138 if (!PyExceptionInstance_Check(value)) {
25139 PyErr_Format(PyExc_TypeError,
25140 "calling %R should have returned an instance of " 25141 "BaseException, not %R",
25142 type, Py_TYPE(value));
25147 PyErr_SetString(PyExc_TypeError,
25148 "raise: exception class must be a subclass of BaseException");
25152 PyObject *fixed_cause;
25153 if (cause == Py_None) {
25154 fixed_cause = NULL;
25155 }
else if (PyExceptionClass_Check(cause)) {
25156 fixed_cause = PyObject_CallObject(cause, NULL);
25157 if (fixed_cause == NULL)
25159 }
else if (PyExceptionInstance_Check(cause)) {
25160 fixed_cause = cause;
25161 Py_INCREF(fixed_cause);
25163 PyErr_SetString(PyExc_TypeError,
25164 "exception causes must derive from " 25168 PyException_SetCause(value, fixed_cause);
25170 PyErr_SetObject(type, value);
25172 #if CYTHON_COMPILING_IN_PYPY 25173 PyObject *tmp_type, *tmp_value, *tmp_tb;
25174 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
25176 PyErr_Restore(tmp_type, tmp_value, tb);
25177 Py_XDECREF(tmp_tb);
25179 PyThreadState *tstate = __Pyx_PyThreadState_Current;
25180 PyObject* tmp_tb = tstate->curexc_traceback;
25181 if (tb != tmp_tb) {
25183 tstate->curexc_traceback = tb;
25184 Py_XDECREF(tmp_tb);
25189 Py_XDECREF(owned_instance);
25195 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
25196 if (unlikely(!type)) {
25197 PyErr_SetString(PyExc_SystemError,
"Missing type object");
25200 if (likely(__Pyx_TypeCheck(obj, type)))
25202 PyErr_Format(PyExc_TypeError,
"Cannot convert %.200s to %.200s",
25203 Py_TYPE(obj)->tp_name, type->tp_name);
25209 __Pyx_init_memviewslice(
struct __pyx_memoryview_obj *memview,
25211 __Pyx_memviewslice *memviewslice,
25212 int memview_is_new_reference)
25214 __Pyx_RefNannyDeclarations
25216 Py_buffer *buf = &memview->view;
25217 __Pyx_RefNannySetupContext(
"init_memviewslice", 0);
25218 if (memviewslice->memview || memviewslice->data) {
25219 PyErr_SetString(PyExc_ValueError,
25220 "memviewslice is already initialized!");
25223 if (buf->strides) {
25224 for (i = 0; i < ndim; i++) {
25225 memviewslice->strides[i] = buf->strides[i];
25228 Py_ssize_t stride = buf->itemsize;
25229 for (i = ndim - 1; i >= 0; i--) {
25230 memviewslice->strides[i] = stride;
25231 stride *= buf->shape[i];
25234 for (i = 0; i < ndim; i++) {
25235 memviewslice->shape[i] = buf->shape[i];
25236 if (buf->suboffsets) {
25237 memviewslice->suboffsets[i] = buf->suboffsets[i];
25239 memviewslice->suboffsets[i] = -1;
25242 memviewslice->memview = memview;
25243 memviewslice->data = (
char *)buf->buf;
25244 if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
25245 Py_INCREF(memview);
25250 memviewslice->memview = 0;
25251 memviewslice->data = 0;
25254 __Pyx_RefNannyFinishContext();
25257 #ifndef Py_NO_RETURN 25258 #define Py_NO_RETURN 25260 static void __pyx_fatalerror(
const char *fmt, ...) Py_NO_RETURN {
25263 #ifdef HAVE_STDARG_PROTOTYPES 25264 va_start(vargs, fmt);
25268 vsnprintf(msg, 200, fmt, vargs);
25270 Py_FatalError(msg);
25272 static CYTHON_INLINE
int 25273 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
25274 PyThread_type_lock lock)
25277 PyThread_acquire_lock(lock, 1);
25278 result = (*acquisition_count)++;
25279 PyThread_release_lock(lock);
25282 static CYTHON_INLINE
int 25283 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
25284 PyThread_type_lock lock)
25287 PyThread_acquire_lock(lock, 1);
25288 result = (*acquisition_count)--;
25289 PyThread_release_lock(lock);
25292 static CYTHON_INLINE
void 25293 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice,
int have_gil,
int lineno)
25296 struct __pyx_memoryview_obj *memview = memslice->memview;
25297 if (!memview || (PyObject *) memview == Py_None)
25299 if (__pyx_get_slice_count(memview) < 0)
25300 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
25301 __pyx_get_slice_count(memview), lineno);
25302 first_time = __pyx_add_acquisition_count(memview) == 0;
25305 Py_INCREF((PyObject *) memview);
25307 PyGILState_STATE _gilstate = PyGILState_Ensure();
25308 Py_INCREF((PyObject *) memview);
25309 PyGILState_Release(_gilstate);
25313 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
25314 int have_gil,
int lineno) {
25316 struct __pyx_memoryview_obj *memview = memslice->memview;
25319 }
else if ((PyObject *) memview == Py_None) {
25320 memslice->memview = NULL;
25323 if (__pyx_get_slice_count(memview) <= 0)
25324 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
25325 __pyx_get_slice_count(memview), lineno);
25326 last_time = __pyx_sub_acquisition_count(memview) == 1;
25327 memslice->data = NULL;
25330 Py_CLEAR(memslice->memview);
25332 PyGILState_STATE _gilstate = PyGILState_Ensure();
25333 Py_CLEAR(memslice->memview);
25334 PyGILState_Release(_gilstate);
25337 memslice->memview = NULL;
25342 static void __Pyx_RaiseBufferIndexError(
int axis) {
25343 PyErr_Format(PyExc_IndexError,
25344 "Out of bounds on buffer access (axis %d)", axis);
25348 static void __Pyx_WriteUnraisable(
const char *name, CYTHON_UNUSED
int clineno,
25349 CYTHON_UNUSED
int lineno, CYTHON_UNUSED
const char *filename,
25350 int full_traceback, CYTHON_UNUSED
int nogil) {
25351 PyObject *old_exc, *old_val, *old_tb;
25353 __Pyx_PyThreadState_declare
25355 PyGILState_STATE state;
25357 state = PyGILState_Ensure();
25359 else state = (PyGILState_STATE)-1;
25362 __Pyx_PyThreadState_assign
25363 __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
25364 if (full_traceback) {
25365 Py_XINCREF(old_exc);
25366 Py_XINCREF(old_val);
25367 Py_XINCREF(old_tb);
25368 __Pyx_ErrRestore(old_exc, old_val, old_tb);
25371 #if PY_MAJOR_VERSION < 3 25372 ctx = PyString_FromString(name);
25374 ctx = PyUnicode_FromString(name);
25376 __Pyx_ErrRestore(old_exc, old_val, old_tb);
25378 PyErr_WriteUnraisable(Py_None);
25380 PyErr_WriteUnraisable(ctx);
25385 PyGILState_Release(state);
25390 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY 25391 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
25393 value = PyDict_GetItemWithError(d, key);
25394 if (unlikely(!value)) {
25395 if (!PyErr_Occurred()) {
25396 if (unlikely(PyTuple_Check(key))) {
25397 PyObject* args = PyTuple_Pack(1, key);
25398 if (likely(args)) {
25399 PyErr_SetObject(PyExc_KeyError, args);
25403 PyErr_SetObject(PyExc_KeyError, key);
25414 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
25415 PyErr_Format(PyExc_ValueError,
25416 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T
"d)", expected);
25420 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
25421 PyErr_Format(PyExc_ValueError,
25422 "need more than %" CYTHON_FORMAT_SSIZE_T
"d value%.1s to unpack",
25423 index, (index == 1) ?
"" :
"s");
25427 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void) {
25428 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
25432 #if CYTHON_USE_EXC_INFO_STACK 25433 static _PyErr_StackItem *
25434 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
25436 _PyErr_StackItem *exc_info = tstate->exc_info;
25437 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
25438 exc_info->previous_item != NULL)
25440 exc_info = exc_info->previous_item;
25447 #if CYTHON_FAST_THREAD_STATE 25448 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25449 #if CYTHON_USE_EXC_INFO_STACK 25450 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
25451 *type = exc_info->exc_type;
25452 *value = exc_info->exc_value;
25453 *tb = exc_info->exc_traceback;
25455 *type = tstate->exc_type;
25456 *value = tstate->exc_value;
25457 *tb = tstate->exc_traceback;
25460 Py_XINCREF(*value);
25463 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
25464 PyObject *tmp_type, *tmp_value, *tmp_tb;
25465 #if CYTHON_USE_EXC_INFO_STACK 25466 _PyErr_StackItem *exc_info = tstate->exc_info;
25467 tmp_type = exc_info->exc_type;
25468 tmp_value = exc_info->exc_value;
25469 tmp_tb = exc_info->exc_traceback;
25470 exc_info->exc_type = type;
25471 exc_info->exc_value = value;
25472 exc_info->exc_traceback = tb;
25474 tmp_type = tstate->exc_type;
25475 tmp_value = tstate->exc_value;
25476 tmp_tb = tstate->exc_traceback;
25477 tstate->exc_type = type;
25478 tstate->exc_value = value;
25479 tstate->exc_traceback = tb;
25481 Py_XDECREF(tmp_type);
25482 Py_XDECREF(tmp_value);
25483 Py_XDECREF(tmp_tb);
25488 #if CYTHON_FAST_THREAD_STATE 25489 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
25491 n = PyTuple_GET_SIZE(tuple);
25492 #if PY_MAJOR_VERSION >= 3 25493 for (i=0; i<
n; i++) {
25494 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
25497 for (i=0; i<
n; i++) {
25498 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
25502 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
25503 PyObject *exc_type = tstate->curexc_type;
25504 if (exc_type == err)
return 1;
25505 if (unlikely(!exc_type))
return 0;
25506 if (unlikely(PyTuple_Check(err)))
25507 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
25508 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
25513 #if CYTHON_FAST_THREAD_STATE 25514 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
25516 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
25519 PyObject *local_type, *local_value, *local_tb;
25520 #if CYTHON_FAST_THREAD_STATE 25521 PyObject *tmp_type, *tmp_value, *tmp_tb;
25522 local_type = tstate->curexc_type;
25523 local_value = tstate->curexc_value;
25524 local_tb = tstate->curexc_traceback;
25525 tstate->curexc_type = 0;
25526 tstate->curexc_value = 0;
25527 tstate->curexc_traceback = 0;
25529 PyErr_Fetch(&local_type, &local_value, &local_tb);
25531 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
25532 #if CYTHON_FAST_THREAD_STATE 25533 if (unlikely(tstate->curexc_type))
25535 if (unlikely(PyErr_Occurred()))
25538 #if PY_MAJOR_VERSION >= 3 25540 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
25544 Py_XINCREF(local_tb);
25545 Py_XINCREF(local_type);
25546 Py_XINCREF(local_value);
25547 *type = local_type;
25548 *value = local_value;
25550 #if CYTHON_FAST_THREAD_STATE 25551 #if CYTHON_USE_EXC_INFO_STACK 25553 _PyErr_StackItem *exc_info = tstate->exc_info;
25554 tmp_type = exc_info->exc_type;
25555 tmp_value = exc_info->exc_value;
25556 tmp_tb = exc_info->exc_traceback;
25557 exc_info->exc_type = local_type;
25558 exc_info->exc_value = local_value;
25559 exc_info->exc_traceback = local_tb;
25562 tmp_type = tstate->exc_type;
25563 tmp_value = tstate->exc_value;
25564 tmp_tb = tstate->exc_traceback;
25565 tstate->exc_type = local_type;
25566 tstate->exc_value = local_value;
25567 tstate->exc_traceback = local_tb;
25569 Py_XDECREF(tmp_type);
25570 Py_XDECREF(tmp_value);
25571 Py_XDECREF(tmp_tb);
25573 PyErr_SetExcInfo(local_type, local_value, local_tb);
25580 Py_XDECREF(local_type);
25581 Py_XDECREF(local_value);
25582 Py_XDECREF(local_tb);
25587 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2) {
25588 PyObject *args, *result = NULL;
25589 #if CYTHON_FAST_PYCALL 25590 if (PyFunction_Check(
function)) {
25591 PyObject *args[2] = {arg1, arg2};
25592 return __Pyx_PyFunction_FastCall(
function, args, 2);
25595 #if CYTHON_FAST_PYCCALL 25596 if (__Pyx_PyFastCFunction_Check(
function)) {
25597 PyObject *args[2] = {arg1, arg2};
25598 return __Pyx_PyCFunction_FastCall(
function, args, 2);
25601 args = PyTuple_New(2);
25602 if (unlikely(!args))
goto done;
25604 PyTuple_SET_ITEM(args, 0, arg1);
25606 PyTuple_SET_ITEM(args, 1, arg2);
25607 Py_INCREF(
function);
25608 result = __Pyx_PyObject_Call(
function, args, NULL);
25610 Py_DECREF(
function);
25616 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals) {
25617 #if CYTHON_COMPILING_IN_PYPY 25618 return PyObject_RichCompareBool(s1, s2, equals);
25621 return (equals == Py_EQ);
25622 }
else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
25623 const char *ps1, *ps2;
25624 Py_ssize_t length = PyBytes_GET_SIZE(s1);
25625 if (length != PyBytes_GET_SIZE(s2))
25626 return (equals == Py_NE);
25627 ps1 = PyBytes_AS_STRING(s1);
25628 ps2 = PyBytes_AS_STRING(s2);
25629 if (ps1[0] != ps2[0]) {
25630 return (equals == Py_NE);
25631 }
else if (length == 1) {
25632 return (equals == Py_EQ);
25635 #if CYTHON_USE_UNICODE_INTERNALS 25636 Py_hash_t hash1, hash2;
25637 hash1 = ((PyBytesObject*)s1)->ob_shash;
25638 hash2 = ((PyBytesObject*)s2)->ob_shash;
25639 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
25640 return (equals == Py_NE);
25643 result = memcmp(ps1, ps2, (
size_t)length);
25644 return (equals == Py_EQ) ? (result == 0) : (result != 0);
25646 }
else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
25647 return (equals == Py_NE);
25648 }
else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
25649 return (equals == Py_NE);
25652 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
25655 result = __Pyx_PyObject_IsTrue(py_result);
25656 Py_DECREF(py_result);
25663 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals) {
25664 #if CYTHON_COMPILING_IN_PYPY 25665 return PyObject_RichCompareBool(s1, s2, equals);
25667 #if PY_MAJOR_VERSION < 3 25668 PyObject* owned_ref = NULL;
25670 int s1_is_unicode, s2_is_unicode;
25674 s1_is_unicode = PyUnicode_CheckExact(s1);
25675 s2_is_unicode = PyUnicode_CheckExact(s2);
25676 #if PY_MAJOR_VERSION < 3 25677 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
25678 owned_ref = PyUnicode_FromObject(s2);
25679 if (unlikely(!owned_ref))
25683 }
else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
25684 owned_ref = PyUnicode_FromObject(s1);
25685 if (unlikely(!owned_ref))
25689 }
else if (((!s2_is_unicode) & (!s1_is_unicode))) {
25690 return __Pyx_PyBytes_Equals(s1, s2, equals);
25693 if (s1_is_unicode & s2_is_unicode) {
25696 void *data1, *data2;
25697 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
25699 length = __Pyx_PyUnicode_GET_LENGTH(s1);
25700 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
25703 #if CYTHON_USE_UNICODE_INTERNALS 25705 Py_hash_t hash1, hash2;
25706 #if CYTHON_PEP393_ENABLED 25707 hash1 = ((PyASCIIObject*)s1)->hash;
25708 hash2 = ((PyASCIIObject*)s2)->hash;
25710 hash1 = ((PyUnicodeObject*)s1)->hash;
25711 hash2 = ((PyUnicodeObject*)s2)->hash;
25713 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
25718 kind = __Pyx_PyUnicode_KIND(s1);
25719 if (kind != __Pyx_PyUnicode_KIND(s2)) {
25722 data1 = __Pyx_PyUnicode_DATA(s1);
25723 data2 = __Pyx_PyUnicode_DATA(s2);
25724 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
25726 }
else if (length == 1) {
25729 int result = memcmp(data1, data2, (
size_t)(length * kind));
25730 #if PY_MAJOR_VERSION < 3 25731 Py_XDECREF(owned_ref);
25733 return (equals == Py_EQ) ? (result == 0) : (result != 0);
25735 }
else if ((s1 == Py_None) & s2_is_unicode) {
25737 }
else if ((s2 == Py_None) & s1_is_unicode) {
25741 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
25742 #if PY_MAJOR_VERSION < 3 25743 Py_XDECREF(owned_ref);
25747 result = __Pyx_PyObject_IsTrue(py_result);
25748 Py_DECREF(py_result);
25752 #if PY_MAJOR_VERSION < 3 25753 Py_XDECREF(owned_ref);
25755 return (equals == Py_EQ);
25757 #if PY_MAJOR_VERSION < 3 25758 Py_XDECREF(owned_ref);
25760 return (equals == Py_NE);
25765 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
25766 Py_ssize_t
q = a / b;
25767 Py_ssize_t
r = a - q*b;
25768 q -= ((r != 0) & ((r ^ b) < 0));
25773 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *
n) {
25774 #if CYTHON_USE_TYPE_SLOTS 25775 #if PY_MAJOR_VERSION >= 3 25776 if (likely(PyUnicode_Check(n)))
25778 if (likely(PyString_Check(n)))
25780 return __Pyx_PyObject_GetAttrStr(o, n);
25782 return PyObject_GetAttr(o, n);
25786 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
25788 if (!j)
return NULL;
25789 r = PyObject_GetItem(o, j);
25793 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
25794 CYTHON_NCP_UNUSED
int wraparound,
25795 CYTHON_NCP_UNUSED
int boundscheck) {
25796 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 25797 Py_ssize_t wrapped_i = i;
25798 if (wraparound & unlikely(i < 0)) {
25799 wrapped_i += PyList_GET_SIZE(o);
25801 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
25802 PyObject *
r = PyList_GET_ITEM(o, wrapped_i);
25806 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
25808 return PySequence_GetItem(o, i);
25811 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
25812 CYTHON_NCP_UNUSED
int wraparound,
25813 CYTHON_NCP_UNUSED
int boundscheck) {
25814 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 25815 Py_ssize_t wrapped_i = i;
25816 if (wraparound & unlikely(i < 0)) {
25817 wrapped_i += PyTuple_GET_SIZE(o);
25819 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
25820 PyObject *
r = PyTuple_GET_ITEM(o, wrapped_i);
25824 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
25826 return PySequence_GetItem(o, i);
25829 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
int is_list,
25830 CYTHON_NCP_UNUSED
int wraparound,
25831 CYTHON_NCP_UNUSED
int boundscheck) {
25832 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS 25833 if (is_list || PyList_CheckExact(o)) {
25834 Py_ssize_t
n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
25835 if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
25836 PyObject *
r = PyList_GET_ITEM(o, n);
25841 else if (PyTuple_CheckExact(o)) {
25842 Py_ssize_t
n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
25843 if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
25844 PyObject *
r = PyTuple_GET_ITEM(o, n);
25849 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
25850 if (likely(m && m->sq_item)) {
25851 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
25852 Py_ssize_t l = m->sq_length(o);
25853 if (likely(l >= 0)) {
25856 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
25861 return m->sq_item(o, i);
25865 if (is_list || PySequence_Check(o)) {
25866 return PySequence_GetItem(o, i);
25869 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
25873 #if CYTHON_USE_TYPE_SLOTS 25874 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
25876 Py_ssize_t key_value;
25877 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
25878 if (unlikely(!(m && m->sq_item))) {
25879 PyErr_Format(PyExc_TypeError,
"'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
25882 key_value = __Pyx_PyIndex_AsSsize_t(index);
25883 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
25884 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
25886 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
25888 PyErr_Format(PyExc_IndexError,
"cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
25892 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
25893 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
25894 if (likely(m && m->mp_subscript)) {
25895 return m->mp_subscript(obj, key);
25897 return __Pyx_PyObject_GetIndex(obj, key);
25902 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
25903 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
25904 const char* encoding,
const char* errors,
25905 PyObject* (*decode_func)(
const char *
s, Py_ssize_t size,
const char *errors)) {
25907 if (unlikely((start < 0) | (stop < 0))) {
25908 size_t slen = strlen(cstring);
25909 if (unlikely(slen > (
size_t) PY_SSIZE_T_MAX)) {
25910 PyErr_SetString(PyExc_OverflowError,
25911 "c-string too long to convert to Python");
25914 length = (Py_ssize_t) slen;
25923 length = stop - start;
25924 if (unlikely(length <= 0))
25925 return PyUnicode_FromUnicode(NULL, 0);
25928 return decode_func(cstring, length, errors);
25930 return PyUnicode_Decode(cstring, length, encoding, errors);
25935 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
25936 __Pyx_PyThreadState_declare
25937 __Pyx_PyThreadState_assign
25938 if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
25940 __Pyx_PyErr_Clear();
25944 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *
n, PyObject *d) {
25945 PyObject *
r = __Pyx_GetAttr(o,
n);
25946 return (likely(r)) ?
r : __Pyx_GetAttr3Default(d);
25950 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS 25951 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
25952 PyObject *dict = Py_TYPE(obj)->tp_dict;
25953 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
25955 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
25956 PyObject **dictptr = NULL;
25957 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
25959 #if CYTHON_COMPILING_IN_CPYTHON 25960 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)obj + offset) : _PyObject_GetDictPtr(obj);
25962 dictptr = _PyObject_GetDictPtr(obj);
25965 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
25967 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
25968 PyObject *dict = Py_TYPE(obj)->tp_dict;
25969 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
25971 return obj_dict_version == __Pyx_get_object_dict_version(obj);
25976 #if CYTHON_USE_DICT_VERSIONS 25977 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
25979 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
25983 #if !CYTHON_AVOID_BORROWED_REFS 25984 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 25985 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
25986 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
25987 if (likely(result)) {
25988 return __Pyx_NewRef(result);
25989 }
else if (unlikely(PyErr_Occurred())) {
25993 result = PyDict_GetItem(__pyx_d, name);
25994 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
25995 if (likely(result)) {
25996 return __Pyx_NewRef(result);
26000 result = PyObject_GetItem(__pyx_d, name);
26001 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
26002 if (likely(result)) {
26003 return __Pyx_NewRef(result);
26007 return __Pyx_GetBuiltinName(name);
26011 #if CYTHON_FAST_THREAD_STATE 26012 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
26013 PyObject *tmp_type, *tmp_value, *tmp_tb;
26014 #if CYTHON_USE_EXC_INFO_STACK 26015 _PyErr_StackItem *exc_info = tstate->exc_info;
26016 tmp_type = exc_info->exc_type;
26017 tmp_value = exc_info->exc_value;
26018 tmp_tb = exc_info->exc_traceback;
26019 exc_info->exc_type = *type;
26020 exc_info->exc_value = *value;
26021 exc_info->exc_traceback = *tb;
26023 tmp_type = tstate->exc_type;
26024 tmp_value = tstate->exc_value;
26025 tmp_tb = tstate->exc_traceback;
26026 tstate->exc_type = *type;
26027 tstate->exc_value = *value;
26028 tstate->exc_traceback = *tb;
26031 *value = tmp_value;
26035 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
26036 PyObject *tmp_type, *tmp_value, *tmp_tb;
26037 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
26038 PyErr_SetExcInfo(*type, *value, *tb);
26040 *value = tmp_value;
26046 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
26047 PyObject *empty_list = 0;
26048 PyObject *module = 0;
26049 PyObject *global_dict = 0;
26050 PyObject *empty_dict = 0;
26052 #if PY_MAJOR_VERSION < 3 26053 PyObject *py_import;
26054 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
26061 empty_list = PyList_New(0);
26066 global_dict = PyModule_GetDict(__pyx_m);
26069 empty_dict = PyDict_New();
26073 #if PY_MAJOR_VERSION >= 3 26075 if (strchr(__Pyx_MODULE_NAME,
'.')) {
26076 module = PyImport_ImportModuleLevelObject(
26077 name, global_dict, empty_dict, list, 1);
26079 if (!PyErr_ExceptionMatches(PyExc_ImportError))
26088 #if PY_MAJOR_VERSION < 3 26089 PyObject *py_level = PyInt_FromLong(level);
26092 module = PyObject_CallFunctionObjArgs(py_import,
26093 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
26094 Py_DECREF(py_level);
26096 module = PyImport_ImportModuleLevelObject(
26097 name, global_dict, empty_dict, list, level);
26102 #if PY_MAJOR_VERSION < 3 26103 Py_XDECREF(py_import);
26105 Py_XDECREF(empty_list);
26106 Py_XDECREF(empty_dict);
26111 #if CYTHON_COMPILING_IN_CPYTHON 26112 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
26118 return b == &PyBaseObject_Type;
26120 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
26122 if (a == b)
return 1;
26126 n = PyTuple_GET_SIZE(mro);
26127 for (i = 0; i <
n; i++) {
26128 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
26133 return __Pyx_InBases(a, b);
26135 #if PY_MAJOR_VERSION == 2 26136 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
26137 PyObject *exception, *value, *tb;
26139 __Pyx_PyThreadState_declare
26140 __Pyx_PyThreadState_assign
26141 __Pyx_ErrFetch(&exception, &value, &tb);
26142 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
26143 if (unlikely(res == -1)) {
26144 PyErr_WriteUnraisable(err);
26148 res = PyObject_IsSubclass(err, exc_type2);
26149 if (unlikely(res == -1)) {
26150 PyErr_WriteUnraisable(err);
26154 __Pyx_ErrRestore(exception, value, tb);
26158 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
26159 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
26161 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
26166 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
26168 assert(PyExceptionClass_Check(exc_type));
26169 n = PyTuple_GET_SIZE(tuple);
26170 #if PY_MAJOR_VERSION >= 3 26171 for (i=0; i<
n; i++) {
26172 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
26175 for (i=0; i<
n; i++) {
26176 PyObject *t = PyTuple_GET_ITEM(tuple, i);
26177 #if PY_MAJOR_VERSION < 3 26178 if (likely(exc_type == t))
return 1;
26180 if (likely(PyExceptionClass_Check(t))) {
26181 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
26187 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
26188 if (likely(err == exc_type))
return 1;
26189 if (likely(PyExceptionClass_Check(err))) {
26190 if (likely(PyExceptionClass_Check(exc_type))) {
26191 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
26192 }
else if (likely(PyTuple_Check(exc_type))) {
26193 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
26197 return PyErr_GivenExceptionMatches(err, exc_type);
26199 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
26200 assert(PyExceptionClass_Check(exc_type1));
26201 assert(PyExceptionClass_Check(exc_type2));
26202 if (likely(err == exc_type1 || err == exc_type2))
return 1;
26203 if (likely(PyExceptionClass_Check(err))) {
26204 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
26206 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
26211 #if !CYTHON_COMPILING_IN_PYPY 26212 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval,
int inplace,
int zerodivision_check) {
26214 (void)zerodivision_check;
26215 #if PY_MAJOR_VERSION < 3 26216 if (likely(PyInt_CheckExact(op1))) {
26217 const long b = intval;
26219 long a = PyInt_AS_LONG(op1);
26220 x = (long)((
unsigned long)a + b);
26221 if (likely((x^a) >= 0 || (x^b) >= 0))
26222 return PyInt_FromLong(x);
26223 return PyLong_Type.tp_as_number->nb_add(op1, op2);
26226 #if CYTHON_USE_PYLONG_INTERNALS 26227 if (likely(PyLong_CheckExact(op1))) {
26228 const long b = intval;
26230 #ifdef HAVE_LONG_LONG 26231 const PY_LONG_LONG llb = intval;
26232 PY_LONG_LONG lla, llx;
26234 const digit* digits = ((PyLongObject*)op1)->ob_digit;
26235 const Py_ssize_t size = Py_SIZE(op1);
26236 if (likely(__Pyx_sst_abs(size) <= 1)) {
26237 a = likely(size) ? digits[0] : 0;
26238 if (size == -1) a = -a;
26242 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
26243 a = -(long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
26245 #ifdef HAVE_LONG_LONG 26246 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
26247 lla = -(PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
26251 CYTHON_FALLTHROUGH;
26253 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
26254 a = (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
26256 #ifdef HAVE_LONG_LONG 26257 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
26258 lla = (PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
26262 CYTHON_FALLTHROUGH;
26264 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
26265 a = -(long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
26267 #ifdef HAVE_LONG_LONG 26268 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
26269 lla = -(PY_LONG_LONG) (((((((
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
26273 CYTHON_FALLTHROUGH;
26275 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
26276 a = (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
26278 #ifdef HAVE_LONG_LONG 26279 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
26280 lla = (PY_LONG_LONG) (((((((
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
26284 CYTHON_FALLTHROUGH;
26286 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
26287 a = -(long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
26289 #ifdef HAVE_LONG_LONG 26290 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
26291 lla = -(PY_LONG_LONG) (((((((((
unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
26295 CYTHON_FALLTHROUGH;
26297 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
26298 a = (long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
26300 #ifdef HAVE_LONG_LONG 26301 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
26302 lla = (PY_LONG_LONG) (((((((((
unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
26306 CYTHON_FALLTHROUGH;
26307 default:
return PyLong_Type.tp_as_number->nb_add(op1, op2);
26311 return PyLong_FromLong(x);
26312 #ifdef HAVE_LONG_LONG 26315 return PyLong_FromLongLong(llx);
26321 if (PyFloat_CheckExact(op1)) {
26322 const long b = intval;
26323 double a = PyFloat_AS_DOUBLE(op1);
26325 PyFPE_START_PROTECT(
"add",
return NULL)
26326 result = ((double)a) + (double)b;
26327 PyFPE_END_PROTECT(result)
26328 return PyFloat_FromDouble(result);
26330 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
26335 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname) {
26336 PyErr_Format(PyExc_UnboundLocalError,
"local variable '%s' referenced before assignment", varname);
26340 static CYTHON_INLINE
long __Pyx_div_long(
long a,
long b) {
26343 q -= ((r != 0) & ((r ^ b) < 0));
26348 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
26349 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
26350 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
26351 PyErr_Format(PyExc_ImportError,
26352 #
if PY_MAJOR_VERSION < 3
26353 "cannot import name %.230s", PyString_AS_STRING(name));
26355 "cannot import name %S", name);
26362 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *o, PyObject *
n) {
26364 if (unlikely(!__Pyx_PyBaseString_Check(n))) {
26365 PyErr_SetString(PyExc_TypeError,
26366 "hasattr(): attribute name must be string");
26369 r = __Pyx_GetAttr(o, n);
26370 if (unlikely(!r)) {
26380 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 26381 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
26382 PyErr_Format(PyExc_AttributeError,
26383 #
if PY_MAJOR_VERSION >= 3
26384 "'%.50s' object has no attribute '%U'",
26385 tp->tp_name, attr_name);
26387 "'%.50s' object has no attribute '%.400s'",
26388 tp->tp_name, PyString_AS_STRING(attr_name));
26392 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
26394 PyTypeObject *tp = Py_TYPE(obj);
26395 if (unlikely(!PyString_Check(attr_name))) {
26396 return PyObject_GenericGetAttr(obj, attr_name);
26398 assert(!tp->tp_dictoffset);
26399 descr = _PyType_Lookup(tp, attr_name);
26400 if (unlikely(!descr)) {
26401 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
26404 #if PY_MAJOR_VERSION < 3 26405 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
26408 descrgetfunc
f = Py_TYPE(descr)->tp_descr_get;
26410 PyObject *res =
f(descr, obj, (PyObject *)tp);
26420 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 26421 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
26422 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
26423 return PyObject_GenericGetAttr(obj, attr_name);
26425 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
26430 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
26432 PyObject *name_attr;
26433 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
26434 if (likely(name_attr)) {
26435 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
26439 if (unlikely(ret < 0)) {
26443 Py_XDECREF(name_attr);
26446 static int __Pyx_setup_reduce(PyObject* type_obj) {
26448 PyObject *object_reduce = NULL;
26449 PyObject *object_reduce_ex = NULL;
26450 PyObject *reduce = NULL;
26451 PyObject *reduce_ex = NULL;
26452 PyObject *reduce_cython = NULL;
26453 PyObject *setstate = NULL;
26454 PyObject *setstate_cython = NULL;
26455 #if CYTHON_USE_PYTYPE_LOOKUP 26456 if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate))
goto __PYX_GOOD;
26458 if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate))
goto __PYX_GOOD;
26460 #if CYTHON_USE_PYTYPE_LOOKUP 26461 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto __PYX_BAD;
26463 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto __PYX_BAD;
26465 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex);
if (unlikely(!reduce_ex))
goto __PYX_BAD;
26466 if (reduce_ex == object_reduce_ex) {
26467 #if CYTHON_USE_PYTYPE_LOOKUP 26468 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto __PYX_BAD;
26470 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto __PYX_BAD;
26472 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce);
if (unlikely(!reduce))
goto __PYX_BAD;
26473 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
26474 reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython);
if (unlikely(!reduce_cython))
goto __PYX_BAD;
26475 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
26476 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
26477 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
26478 if (!setstate) PyErr_Clear();
26479 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
26480 setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython);
if (unlikely(!setstate_cython))
goto __PYX_BAD;
26481 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
26482 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
26484 PyType_Modified((PyTypeObject*)type_obj);
26489 if (!PyErr_Occurred())
26490 PyErr_Format(PyExc_RuntimeError,
"Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
26493 #if !CYTHON_USE_PYTYPE_LOOKUP 26494 Py_XDECREF(object_reduce);
26495 Py_XDECREF(object_reduce_ex);
26497 Py_XDECREF(reduce);
26498 Py_XDECREF(reduce_ex);
26499 Py_XDECREF(reduce_cython);
26500 Py_XDECREF(setstate);
26501 Py_XDECREF(setstate_cython);
26506 static int __Pyx_SetVtable(PyObject *dict,
void *vtable) {
26507 #if PY_VERSION_HEX >= 0x02070000 26508 PyObject *ob = PyCapsule_New(vtable, 0, 0);
26510 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
26514 if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
26524 #ifndef __PYX_HAVE_RT_ImportType 26525 #define __PYX_HAVE_RT_ImportType 26526 static PyTypeObject *__Pyx_ImportType(PyObject *module,
const char *module_name,
const char *class_name,
26527 size_t size,
enum __Pyx_ImportType_CheckSize check_size)
26529 PyObject *result = 0;
26531 Py_ssize_t basicsize;
26532 #ifdef Py_LIMITED_API 26533 PyObject *py_basicsize;
26535 result = PyObject_GetAttrString(module, class_name);
26538 if (!PyType_Check(result)) {
26539 PyErr_Format(PyExc_TypeError,
26540 "%.200s.%.200s is not a type object",
26541 module_name, class_name);
26544 #ifndef Py_LIMITED_API 26545 basicsize = ((PyTypeObject *)result)->tp_basicsize;
26547 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
26550 basicsize = PyLong_AsSsize_t(py_basicsize);
26551 Py_DECREF(py_basicsize);
26553 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
26556 if ((
size_t)basicsize < size) {
26557 PyErr_Format(PyExc_ValueError,
26558 "%.200s.%.200s size changed, may indicate binary incompatibility. " 26559 "Expected %zd from C header, got %zd from PyObject",
26560 module_name, class_name, size, basicsize);
26563 if (check_size == __Pyx_ImportType_CheckSize_Error && (
size_t)basicsize != size) {
26564 PyErr_Format(PyExc_ValueError,
26565 "%.200s.%.200s size changed, may indicate binary incompatibility. " 26566 "Expected %zd from C header, got %zd from PyObject",
26567 module_name, class_name, size, basicsize);
26570 else if (check_size == __Pyx_ImportType_CheckSize_Warn && (
size_t)basicsize > size) {
26571 PyOS_snprintf(warning,
sizeof(warning),
26572 "%s.%s size changed, may indicate binary incompatibility. " 26573 "Expected %zd from C header, got %zd from PyObject",
26574 module_name, class_name, size, basicsize);
26575 if (PyErr_WarnEx(NULL, warning, 0) < 0)
goto bad;
26577 return (PyTypeObject *)result;
26579 Py_XDECREF(result);
26585 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
26586 Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
26587 for (i=0; i < nbases; i++) {
26588 PyTypeObject *tmptype;
26589 PyObject *tmp = PyTuple_GET_ITEM(bases, i);
26590 tmptype = Py_TYPE(tmp);
26591 #if PY_MAJOR_VERSION < 3 26592 if (tmptype == &PyClass_Type)
26596 metaclass = tmptype;
26599 if (PyType_IsSubtype(metaclass, tmptype))
26601 if (PyType_IsSubtype(tmptype, metaclass)) {
26602 metaclass = tmptype;
26605 PyErr_SetString(PyExc_TypeError,
26606 "metaclass conflict: " 26607 "the metaclass of a derived class " 26608 "must be a (non-strict) subclass " 26609 "of the metaclasses of all its bases");
26613 #if PY_MAJOR_VERSION < 3 26614 metaclass = &PyClass_Type;
26616 metaclass = &PyType_Type;
26619 Py_INCREF((PyObject*) metaclass);
26620 return (PyObject*) metaclass;
26624 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
26625 PyObject* fake_module;
26626 PyTypeObject* cached_type = NULL;
26627 fake_module = PyImport_AddModule((
char*)
"_cython_" CYTHON_ABI);
26628 if (!fake_module)
return NULL;
26629 Py_INCREF(fake_module);
26630 cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
26632 if (!PyType_Check((PyObject*)cached_type)) {
26633 PyErr_Format(PyExc_TypeError,
26634 "Shared Cython type %.200s is not a type object",
26638 if (cached_type->tp_basicsize != type->tp_basicsize) {
26639 PyErr_Format(PyExc_TypeError,
26640 "Shared Cython type %.200s has the wrong size, try recompiling",
26645 if (!PyErr_ExceptionMatches(PyExc_AttributeError))
goto bad;
26647 if (PyType_Ready(type) < 0)
goto bad;
26648 if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
26651 cached_type = type;
26654 Py_DECREF(fake_module);
26655 return cached_type;
26657 Py_XDECREF(cached_type);
26658 cached_type = NULL;
26663 #include <structmember.h> 26665 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *closure)
26667 if (unlikely(op->func_doc == NULL)) {
26668 if (op->func.m_ml->ml_doc) {
26669 #if PY_MAJOR_VERSION >= 3 26670 op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
26672 op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
26674 if (unlikely(op->func_doc == NULL))
26677 Py_INCREF(Py_None);
26681 Py_INCREF(op->func_doc);
26682 return op->func_doc;
26685 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
26687 PyObject *tmp = op->func_doc;
26688 if (value == NULL) {
26692 op->func_doc = value;
26697 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
26699 if (unlikely(op->func_name == NULL)) {
26700 #if PY_MAJOR_VERSION >= 3 26701 op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
26703 op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
26705 if (unlikely(op->func_name == NULL))
26708 Py_INCREF(op->func_name);
26709 return op->func_name;
26712 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
26715 #if PY_MAJOR_VERSION >= 3 26716 if (unlikely(value == NULL || !PyUnicode_Check(value)))
26718 if (unlikely(value == NULL || !PyString_Check(value)))
26721 PyErr_SetString(PyExc_TypeError,
26722 "__name__ must be set to a string object");
26725 tmp = op->func_name;
26727 op->func_name = value;
26732 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
26734 Py_INCREF(op->func_qualname);
26735 return op->func_qualname;
26738 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
26741 #if PY_MAJOR_VERSION >= 3 26742 if (unlikely(value == NULL || !PyUnicode_Check(value)))
26744 if (unlikely(value == NULL || !PyString_Check(value)))
26747 PyErr_SetString(PyExc_TypeError,
26748 "__qualname__ must be set to a string object");
26751 tmp = op->func_qualname;
26753 op->func_qualname = value;
26758 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED
void *closure)
26761 self = m->func_closure;
26768 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
26770 if (unlikely(op->func_dict == NULL)) {
26771 op->func_dict = PyDict_New();
26772 if (unlikely(op->func_dict == NULL))
26775 Py_INCREF(op->func_dict);
26776 return op->func_dict;
26779 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
26782 if (unlikely(value == NULL)) {
26783 PyErr_SetString(PyExc_TypeError,
26784 "function's dictionary may not be deleted");
26787 if (unlikely(!PyDict_Check(value))) {
26788 PyErr_SetString(PyExc_TypeError,
26789 "setting function's dictionary to a non-dict");
26792 tmp = op->func_dict;
26794 op->func_dict = value;
26799 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
26801 Py_INCREF(op->func_globals);
26802 return op->func_globals;
26805 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
26807 Py_INCREF(Py_None);
26811 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
26813 PyObject* result = (op->func_code) ? op->func_code : Py_None;
26818 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
26820 PyObject *res = op->defaults_getter((PyObject *) op);
26821 if (unlikely(!res))
26823 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 26824 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
26825 Py_INCREF(op->defaults_tuple);
26826 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
26827 Py_INCREF(op->defaults_kwdict);
26829 op->defaults_tuple = PySequence_ITEM(res, 0);
26830 if (unlikely(!op->defaults_tuple)) result = -1;
26832 op->defaults_kwdict = PySequence_ITEM(res, 1);
26833 if (unlikely(!op->defaults_kwdict)) result = -1;
26840 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
26844 }
else if (value != Py_None && !PyTuple_Check(value)) {
26845 PyErr_SetString(PyExc_TypeError,
26846 "__defaults__ must be set to a tuple object");
26850 tmp = op->defaults_tuple;
26851 op->defaults_tuple = value;
26856 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
26857 PyObject* result = op->defaults_tuple;
26858 if (unlikely(!result)) {
26859 if (op->defaults_getter) {
26860 if (__Pyx_CyFunction_init_defaults(op) < 0)
return NULL;
26861 result = op->defaults_tuple;
26870 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
26874 }
else if (value != Py_None && !PyDict_Check(value)) {
26875 PyErr_SetString(PyExc_TypeError,
26876 "__kwdefaults__ must be set to a dict object");
26880 tmp = op->defaults_kwdict;
26881 op->defaults_kwdict = value;
26886 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
26887 PyObject* result = op->defaults_kwdict;
26888 if (unlikely(!result)) {
26889 if (op->defaults_getter) {
26890 if (__Pyx_CyFunction_init_defaults(op) < 0)
return NULL;
26891 result = op->defaults_kwdict;
26900 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
26902 if (!value || value == Py_None) {
26904 }
else if (!PyDict_Check(value)) {
26905 PyErr_SetString(PyExc_TypeError,
26906 "__annotations__ must be set to a dict object");
26910 tmp = op->func_annotations;
26911 op->func_annotations = value;
26916 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
26917 PyObject* result = op->func_annotations;
26918 if (unlikely(!result)) {
26919 result = PyDict_New();
26920 if (unlikely(!result))
return NULL;
26921 op->func_annotations = result;
26926 static PyGetSetDef __pyx_CyFunction_getsets[] = {
26927 {(
char *)
"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
26928 {(
char *)
"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
26929 {(
char *)
"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
26930 {(
char *)
"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
26931 {(
char *)
"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
26932 {(
char *)
"__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
26933 {(
char *)
"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
26934 {(
char *)
"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
26935 {(
char *)
"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
26936 {(
char *)
"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
26937 {(
char *)
"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
26938 {(
char *)
"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
26939 {(
char *)
"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
26940 {(
char *)
"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
26941 {(
char *)
"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
26942 {(
char *)
"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
26943 {(
char *)
"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
26944 {(
char *)
"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
26947 static PyMemberDef __pyx_CyFunction_members[] = {
26948 {(
char *)
"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
26952 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
26954 #if PY_MAJOR_VERSION >= 3 26955 return PyUnicode_FromString(m->func.m_ml->ml_name);
26957 return PyString_FromString(m->func.m_ml->ml_name);
26960 static PyMethodDef __pyx_CyFunction_methods[] = {
26961 {
"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
26964 #if PY_VERSION_HEX < 0x030500A0 26965 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) 26967 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) 26969 static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml,
int flags, PyObject* qualname,
26970 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
26971 __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
26975 __Pyx_CyFunction_weakreflist(op) = NULL;
26976 op->func.m_ml = ml;
26977 op->func.m_self = (PyObject *) op;
26978 Py_XINCREF(closure);
26979 op->func_closure = closure;
26980 Py_XINCREF(module);
26981 op->func.m_module = module;
26982 op->func_dict = NULL;
26983 op->func_name = NULL;
26984 Py_INCREF(qualname);
26985 op->func_qualname = qualname;
26986 op->func_doc = NULL;
26987 op->func_classobj = NULL;
26988 op->func_globals = globals;
26989 Py_INCREF(op->func_globals);
26991 op->func_code = code;
26992 op->defaults_pyobjects = 0;
26993 op->defaults_size = 0;
26994 op->defaults = NULL;
26995 op->defaults_tuple = NULL;
26996 op->defaults_kwdict = NULL;
26997 op->defaults_getter = NULL;
26998 op->func_annotations = NULL;
26999 PyObject_GC_Track(op);
27000 return (PyObject *) op;
27003 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
27005 Py_CLEAR(m->func_closure);
27006 Py_CLEAR(m->func.m_module);
27007 Py_CLEAR(m->func_dict);
27008 Py_CLEAR(m->func_name);
27009 Py_CLEAR(m->func_qualname);
27010 Py_CLEAR(m->func_doc);
27011 Py_CLEAR(m->func_globals);
27012 Py_CLEAR(m->func_code);
27013 Py_CLEAR(m->func_classobj);
27014 Py_CLEAR(m->defaults_tuple);
27015 Py_CLEAR(m->defaults_kwdict);
27016 Py_CLEAR(m->func_annotations);
27018 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
27020 for (i = 0; i < m->defaults_pyobjects; i++)
27021 Py_XDECREF(pydefaults[i]);
27022 PyObject_Free(m->defaults);
27023 m->defaults = NULL;
27027 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
27029 if (__Pyx_CyFunction_weakreflist(m) != NULL)
27030 PyObject_ClearWeakRefs((PyObject *) m);
27031 __Pyx_CyFunction_clear(m);
27032 PyObject_GC_Del(m);
27034 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
27036 PyObject_GC_UnTrack(m);
27037 __Pyx__CyFunction_dealloc(m);
27039 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit,
void *arg)
27041 Py_VISIT(m->func_closure);
27042 Py_VISIT(m->func.m_module);
27043 Py_VISIT(m->func_dict);
27044 Py_VISIT(m->func_name);
27045 Py_VISIT(m->func_qualname);
27046 Py_VISIT(m->func_doc);
27047 Py_VISIT(m->func_globals);
27048 Py_VISIT(m->func_code);
27049 Py_VISIT(m->func_classobj);
27050 Py_VISIT(m->defaults_tuple);
27051 Py_VISIT(m->defaults_kwdict);
27053 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
27055 for (i = 0; i < m->defaults_pyobjects; i++)
27056 Py_VISIT(pydefaults[i]);
27060 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
27062 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
27063 if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
27067 if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
27069 type = (PyObject *)(Py_TYPE(obj));
27070 return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
27072 if (obj == Py_None)
27074 return __Pyx_PyMethod_New(func, obj, type);
27077 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
27079 #if PY_MAJOR_VERSION >= 3 27080 return PyUnicode_FromFormat(
"<cyfunction %U at %p>",
27081 op->func_qualname, (
void *)op);
27083 return PyString_FromFormat(
"<cyfunction %s at %p>",
27084 PyString_AsString(op->func_qualname), (
void *)op);
27087 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *
self, PyObject *arg, PyObject *kw) {
27088 PyCFunctionObject*
f = (PyCFunctionObject*)func;
27089 PyCFunction meth = f->m_ml->ml_meth;
27091 switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
27093 if (likely(kw == NULL || PyDict_Size(kw) == 0))
27094 return (*meth)(
self, arg);
27096 case METH_VARARGS | METH_KEYWORDS:
27097 return (*(PyCFunctionWithKeywords)(
void*)meth)(
self, arg, kw);
27099 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
27100 size = PyTuple_GET_SIZE(arg);
27101 if (likely(size == 0))
27102 return (*meth)(
self, NULL);
27103 PyErr_Format(PyExc_TypeError,
27104 "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T
"d given)",
27105 f->m_ml->ml_name, size);
27110 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
27111 size = PyTuple_GET_SIZE(arg);
27112 if (likely(size == 1)) {
27113 PyObject *result, *arg0;
27114 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 27115 arg0 = PyTuple_GET_ITEM(arg, 0);
27117 arg0 = PySequence_ITEM(arg, 0);
if (unlikely(!arg0))
return NULL;
27119 result = (*meth)(
self, arg0);
27120 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) 27125 PyErr_Format(PyExc_TypeError,
27126 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T
"d given)",
27127 f->m_ml->ml_name, size);
27132 PyErr_SetString(PyExc_SystemError,
"Bad call flags in " 27133 "__Pyx_CyFunction_Call. METH_OLDARGS is no " 27134 "longer supported!");
27137 PyErr_Format(PyExc_TypeError,
"%.200s() takes no keyword arguments",
27141 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
27142 return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
27144 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
27146 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
27147 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
27149 PyObject *new_args;
27151 argc = PyTuple_GET_SIZE(args);
27152 new_args = PyTuple_GetSlice(args, 1, argc);
27153 if (unlikely(!new_args))
27155 self = PyTuple_GetItem(args, 0);
27156 if (unlikely(!
self)) {
27157 Py_DECREF(new_args);
27160 result = __Pyx_CyFunction_CallMethod(func,
self, new_args, kw);
27161 Py_DECREF(new_args);
27163 result = __Pyx_CyFunction_Call(func, args, kw);
27167 static PyTypeObject __pyx_CyFunctionType_type = {
27168 PyVarObject_HEAD_INIT(0, 0)
27169 "cython_function_or_method",
27170 sizeof(__pyx_CyFunctionObject),
27172 (destructor) __Pyx_CyFunction_dealloc,
27176 #if PY_MAJOR_VERSION < 3 27181 (reprfunc) __Pyx_CyFunction_repr,
27186 __Pyx_CyFunction_CallAsMethod,
27191 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
27193 (traverseproc) __Pyx_CyFunction_traverse,
27194 (inquiry) __Pyx_CyFunction_clear,
27196 #
if PY_VERSION_HEX < 0x030500A0
27197 offsetof(__pyx_CyFunctionObject, func_weakreflist),
27199 offsetof(PyCFunctionObject, m_weakreflist),
27203 __pyx_CyFunction_methods,
27204 __pyx_CyFunction_members,
27205 __pyx_CyFunction_getsets,
27208 __Pyx_CyFunction_descr_get,
27210 offsetof(__pyx_CyFunctionObject, func_dict),
27223 #if PY_VERSION_HEX >= 0x030400a1 27226 #if PY_VERSION_HEX >= 0x030800b1 27229 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 27233 static int __pyx_CyFunction_init(
void) {
27234 __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
27235 if (unlikely(__pyx_CyFunctionType == NULL)) {
27240 static CYTHON_INLINE
void *__Pyx_CyFunction_InitDefaults(PyObject *func,
size_t size,
int pyobjects) {
27241 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
27242 m->defaults = PyObject_Malloc(size);
27243 if (unlikely(!m->defaults))
27244 return PyErr_NoMemory();
27245 memset(m->defaults, 0, size);
27246 m->defaults_pyobjects = pyobjects;
27247 m->defaults_size = size;
27248 return m->defaults;
27250 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
27251 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
27252 m->defaults_tuple = tuple;
27255 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
27256 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
27257 m->defaults_kwdict = dict;
27260 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
27261 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
27262 m->func_annotations = dict;
27267 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
27268 PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
27271 PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
27273 PyObject *pargs = PyTuple_Pack(2, name, bases);
27274 if (unlikely(!pargs)) {
27278 ns = PyObject_Call(prep, pargs, mkw);
27282 if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
27292 if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0))
goto bad;
27293 if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0))
goto bad;
27294 if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0))
goto bad;
27300 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
27301 PyObject *dict, PyObject *mkw,
27302 int calculate_metaclass,
int allow_py2_metaclass) {
27303 PyObject *result, *margs;
27304 PyObject *owned_metaclass = NULL;
27305 if (allow_py2_metaclass) {
27306 owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
27307 if (owned_metaclass) {
27308 metaclass = owned_metaclass;
27309 }
else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
27315 if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
27316 metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
27317 Py_XDECREF(owned_metaclass);
27318 if (unlikely(!metaclass))
27320 owned_metaclass = metaclass;
27322 margs = PyTuple_Pack(3, name, bases, dict);
27323 if (unlikely(!margs)) {
27326 result = PyObject_Call(metaclass, margs, mkw);
27329 Py_XDECREF(owned_metaclass);
27334 #ifndef CYTHON_CLINE_IN_TRACEBACK 27335 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate,
int c_line) {
27336 PyObject *use_cline;
27337 PyObject *ptype, *pvalue, *ptraceback;
27338 #if CYTHON_COMPILING_IN_CPYTHON 27339 PyObject **cython_runtime_dict;
27341 if (unlikely(!__pyx_cython_runtime)) {
27344 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
27345 #if CYTHON_COMPILING_IN_CPYTHON 27346 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
27347 if (likely(cython_runtime_dict)) {
27348 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
27349 use_cline, *cython_runtime_dict,
27350 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
27354 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
27355 if (use_cline_obj) {
27356 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
27357 Py_DECREF(use_cline_obj);
27365 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
27367 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
27370 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
27376 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
27377 int start = 0, mid = 0, end = count - 1;
27378 if (end >= 0 && code_line > entries[end].code_line) {
27381 while (start < end) {
27382 mid = start + (end - start) / 2;
27383 if (code_line < entries[mid].code_line) {
27385 }
else if (code_line > entries[mid].code_line) {
27391 if (code_line <= entries[mid].code_line) {
27397 static PyCodeObject *__pyx_find_code_object(
int code_line) {
27398 PyCodeObject* code_object;
27400 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
27403 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
27404 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
27407 code_object = __pyx_code_cache.entries[
pos].code_object;
27408 Py_INCREF(code_object);
27409 return code_object;
27411 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
27413 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
27414 if (unlikely(!code_line)) {
27417 if (unlikely(!entries)) {
27418 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
27419 if (likely(entries)) {
27420 __pyx_code_cache.entries = entries;
27421 __pyx_code_cache.max_count = 64;
27422 __pyx_code_cache.count = 1;
27423 entries[0].code_line = code_line;
27424 entries[0].code_object = code_object;
27425 Py_INCREF(code_object);
27429 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
27430 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
27431 PyCodeObject* tmp = entries[
pos].code_object;
27432 entries[
pos].code_object = code_object;
27436 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
27437 int new_max = __pyx_code_cache.max_count + 64;
27438 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
27439 __pyx_code_cache.entries, ((
size_t)new_max) *
sizeof(__Pyx_CodeObjectCacheEntry));
27440 if (unlikely(!entries)) {
27443 __pyx_code_cache.entries = entries;
27444 __pyx_code_cache.max_count = new_max;
27446 for (i=__pyx_code_cache.count; i>pos; i--) {
27447 entries[i] = entries[i-1];
27449 entries[
pos].code_line = code_line;
27450 entries[
pos].code_object = code_object;
27451 __pyx_code_cache.count++;
27452 Py_INCREF(code_object);
27456 #include "compile.h" 27457 #include "frameobject.h" 27458 #include "traceback.h" 27459 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
27460 const char *funcname,
int c_line,
27461 int py_line,
const char *filename) {
27462 PyCodeObject *py_code = 0;
27463 PyObject *py_srcfile = 0;
27464 PyObject *py_funcname = 0;
27465 #if PY_MAJOR_VERSION < 3 27466 py_srcfile = PyString_FromString(filename);
27468 py_srcfile = PyUnicode_FromString(filename);
27470 if (!py_srcfile)
goto bad;
27472 #if PY_MAJOR_VERSION < 3 27473 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
27475 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
27479 #if PY_MAJOR_VERSION < 3 27480 py_funcname = PyString_FromString(funcname);
27482 py_funcname = PyUnicode_FromString(funcname);
27485 if (!py_funcname)
goto bad;
27486 py_code = __Pyx_PyCode_New(
27503 Py_DECREF(py_srcfile);
27504 Py_DECREF(py_funcname);
27507 Py_XDECREF(py_srcfile);
27508 Py_XDECREF(py_funcname);
27511 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
27512 int py_line,
const char *filename) {
27513 PyCodeObject *py_code = 0;
27514 PyFrameObject *py_frame = 0;
27515 PyThreadState *tstate = __Pyx_PyThreadState_Current;
27517 c_line = __Pyx_CLineForTraceback(tstate, c_line);
27519 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
27521 py_code = __Pyx_CreateCodeObjectForTraceback(
27522 funcname, c_line, py_line, filename);
27523 if (!py_code)
goto bad;
27524 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
27526 py_frame = PyFrame_New(
27532 if (!py_frame)
goto bad;
27533 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
27534 PyTraceBack_Here(py_frame);
27536 Py_XDECREF(py_code);
27537 Py_XDECREF(py_frame);
27540 #if PY_MAJOR_VERSION < 3 27541 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags) {
27542 if (PyObject_CheckBuffer(obj))
return PyObject_GetBuffer(obj, view, flags);
27543 if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray))
return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
27544 if (__Pyx_TypeCheck(obj, __pyx_array_type))
return __pyx_array_getbuffer(obj, view, flags);
27545 if (__Pyx_TypeCheck(obj, __pyx_memoryview_type))
return __pyx_memoryview_getbuffer(obj, view, flags);
27546 PyErr_Format(PyExc_TypeError,
"'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
27549 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
27550 PyObject *obj = view->obj;
27552 if (PyObject_CheckBuffer(obj)) {
27553 PyBuffer_Release(view);
27557 else if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view);
27566 __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim)
27568 int i, index, step, start;
27569 Py_ssize_t itemsize = mvs.memview->view.itemsize;
27570 if (order ==
'F') {
27577 for (i = 0; i < ndim; i++) {
27578 index = start + step * i;
27579 if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
27581 itemsize *= mvs.shape[index];
27588 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
27589 void **out_start,
void **out_end,
27590 int ndim,
size_t itemsize)
27594 start = end = slice->data;
27595 for (i = 0; i < ndim; i++) {
27596 Py_ssize_t stride = slice->strides[i];
27597 Py_ssize_t extent = slice->shape[i];
27599 *out_start = *out_end = start;
27603 end += stride * (extent - 1);
27605 start += stride * (extent - 1);
27608 *out_start = start;
27609 *out_end = end + itemsize;
27612 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
27613 __Pyx_memviewslice *slice2,
27614 int ndim,
size_t itemsize)
27616 void *start1, *end1, *start2, *end2;
27617 __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
27618 __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
27619 return (start1 < end2) && (start2 < end1);
27623 static CYTHON_INLINE PyObject *
27624 __pyx_capsule_create(
void *p, CYTHON_UNUSED
const char *sig)
27627 #if PY_VERSION_HEX >= 0x02070000 27628 cobj = PyCapsule_New(p, sig, NULL);
27630 cobj = PyCObject_FromVoidPtr(p, NULL);
27636 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ 27637 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) 27638 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ 27639 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) 27640 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ 27642 func_type value = func_value;\ 27643 if (sizeof(target_type) < sizeof(func_type)) {\ 27644 if (unlikely(value != (func_type) (target_type) value)) {\ 27645 func_type zero = 0;\ 27646 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ 27647 return (target_type) -1;\ 27648 if (is_unsigned && unlikely(value < zero))\ 27649 goto raise_neg_overflow;\ 27651 goto raise_overflow;\ 27654 return (target_type) value;\ 27658 #if CYTHON_CCOMPLEX 27660 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
27661 return ::std::complex< float >(x, y);
27664 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
27665 return x + y*(__pyx_t_float_complex)_Complex_I;
27669 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
27670 __pyx_t_float_complex
z;
27678 #if CYTHON_CCOMPLEX 27680 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27681 return (a.real == b.real) && (a.imag == b.imag);
27683 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27684 __pyx_t_float_complex
z;
27685 z.real = a.real + b.real;
27686 z.imag = a.imag + b.imag;
27689 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27690 __pyx_t_float_complex
z;
27691 z.real = a.real - b.real;
27692 z.imag = a.imag - b.imag;
27695 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27696 __pyx_t_float_complex
z;
27697 z.real = a.real * b.real - a.imag * b.imag;
27698 z.imag = a.real * b.imag + a.imag * b.real;
27702 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27704 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
27705 }
else if (fabsf(b.real) >= fabsf(b.imag)) {
27706 if (b.real == 0 && b.imag == 0) {
27707 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
27709 float r = b.imag / b.real;
27710 float s = (float)(1.0) / (b.real + b.imag *
r);
27711 return __pyx_t_float_complex_from_parts(
27712 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
27715 float r = b.real / b.imag;
27716 float s = (float)(1.0) / (b.imag + b.real *
r);
27717 return __pyx_t_float_complex_from_parts(
27718 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
27722 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27724 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
27726 float denom = b.real * b.real + b.imag * b.imag;
27727 return __pyx_t_float_complex_from_parts(
27728 (a.real * b.real + a.imag * b.imag) / denom,
27729 (a.imag * b.real - a.real * b.imag) / denom);
27733 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
27734 __pyx_t_float_complex
z;
27739 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
27740 return (a.real == 0) && (a.imag == 0);
27742 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
27743 __pyx_t_float_complex
z;
27749 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex
z) {
27750 #if !defined(HAVE_HYPOT) || defined(_MSC_VER) 27751 return sqrtf(z.real*z.real + z.imag*z.imag);
27753 return hypotf(z.real, z.imag);
27756 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27757 __pyx_t_float_complex
z;
27758 float r, lnr, theta, z_r, z_theta;
27759 if (b.imag == 0 && b.real == (
int)b.real) {
27761 float denom = a.real * a.real + a.imag * a.imag;
27762 a.real = a.real / denom;
27763 a.imag = -a.imag / denom;
27766 switch ((
int)b.real) {
27774 return __Pyx_c_prod_float(a, a);
27776 z = __Pyx_c_prod_float(a, a);
27777 return __Pyx_c_prod_float(z, a);
27779 z = __Pyx_c_prod_float(a, a);
27780 return __Pyx_c_prod_float(z, z);
27786 }
else if (b.imag == 0) {
27787 z.real = powf(a.real, b.real);
27790 }
else if (a.real > 0) {
27795 theta = atan2f(0.0, -1.0);
27798 r = __Pyx_c_abs_float(a);
27799 theta = atan2f(a.imag, a.real);
27802 z_r = expf(lnr * b.real - theta * b.imag);
27803 z_theta = theta * b.real + lnr * b.imag;
27804 z.real = z_r * cosf(z_theta);
27805 z.imag = z_r * sinf(z_theta);
27812 #if CYTHON_CCOMPLEX 27814 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
27815 return ::std::complex< double >(x, y);
27818 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
27819 return x + y*(__pyx_t_double_complex)_Complex_I;
27823 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
27824 __pyx_t_double_complex
z;
27832 #if CYTHON_CCOMPLEX 27834 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27835 return (a.real == b.real) && (a.imag == b.imag);
27837 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27838 __pyx_t_double_complex
z;
27839 z.real = a.real + b.real;
27840 z.imag = a.imag + b.imag;
27843 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27844 __pyx_t_double_complex
z;
27845 z.real = a.real - b.real;
27846 z.imag = a.imag - b.imag;
27849 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27850 __pyx_t_double_complex
z;
27851 z.real = a.real * b.real - a.imag * b.imag;
27852 z.imag = a.real * b.imag + a.imag * b.real;
27856 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27858 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
27859 }
else if (fabs(b.real) >= fabs(b.imag)) {
27860 if (b.real == 0 && b.imag == 0) {
27861 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
27863 double r = b.imag / b.real;
27864 double s = (double)(1.0) / (b.real + b.imag *
r);
27865 return __pyx_t_double_complex_from_parts(
27866 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
27869 double r = b.real / b.imag;
27870 double s = (double)(1.0) / (b.imag + b.real *
r);
27871 return __pyx_t_double_complex_from_parts(
27872 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
27876 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27878 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
27880 double denom = b.real * b.real + b.imag * b.imag;
27881 return __pyx_t_double_complex_from_parts(
27882 (a.real * b.real + a.imag * b.imag) / denom,
27883 (a.imag * b.real - a.real * b.imag) / denom);
27887 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
27888 __pyx_t_double_complex
z;
27893 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
27894 return (a.real == 0) && (a.imag == 0);
27896 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
27897 __pyx_t_double_complex
z;
27903 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex
z) {
27904 #if !defined(HAVE_HYPOT) || defined(_MSC_VER) 27905 return sqrt(z.real*z.real + z.imag*z.imag);
27907 return hypot(z.real, z.imag);
27910 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27911 __pyx_t_double_complex
z;
27912 double r, lnr, theta, z_r, z_theta;
27913 if (b.imag == 0 && b.real == (
int)b.real) {
27915 double denom = a.real * a.real + a.imag * a.imag;
27916 a.real = a.real / denom;
27917 a.imag = -a.imag / denom;
27920 switch ((
int)b.real) {
27928 return __Pyx_c_prod_double(a, a);
27930 z = __Pyx_c_prod_double(a, a);
27931 return __Pyx_c_prod_double(z, a);
27933 z = __Pyx_c_prod_double(a, a);
27934 return __Pyx_c_prod_double(z, z);
27940 }
else if (b.imag == 0) {
27941 z.real = pow(a.real, b.real);
27944 }
else if (a.real > 0) {
27949 theta = atan2(0.0, -1.0);
27952 r = __Pyx_c_abs_double(a);
27953 theta = atan2(a.imag, a.real);
27956 z_r = exp(lnr * b.real - theta * b.imag);
27957 z_theta = theta * b.real + lnr * b.imag;
27958 z.real = z_r * cos(z_theta);
27959 z.imag = z_r * sin(z_theta);
27966 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
27967 const int neg_one = (int) ((
int) 0 - (int) 1), const_zero = (int) 0;
27968 const int is_unsigned = neg_one > const_zero;
27970 if (
sizeof(
int) <
sizeof(long)) {
27971 return PyInt_FromLong((
long) value);
27972 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
27973 return PyLong_FromUnsignedLong((
unsigned long) value);
27974 #ifdef HAVE_LONG_LONG 27975 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
27976 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
27980 if (
sizeof(
int) <=
sizeof(
long)) {
27981 return PyInt_FromLong((
long) value);
27982 #ifdef HAVE_LONG_LONG 27983 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
27984 return PyLong_FromLongLong((PY_LONG_LONG) value);
27989 int one = 1;
int little = (int)*(
unsigned char *)&one;
27990 unsigned char *bytes = (
unsigned char *)&value;
27991 return _PyLong_FromByteArray(bytes,
sizeof(
int),
27992 little, !is_unsigned);
27997 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(
enum NPY_TYPES value) {
27998 const enum NPY_TYPES neg_one = (
enum NPY_TYPES) ((
enum NPY_TYPES) 0 - (
enum NPY_TYPES) 1), const_zero = (
enum NPY_TYPES) 0;
27999 const int is_unsigned = neg_one > const_zero;
28001 if (
sizeof(
enum NPY_TYPES) <
sizeof(long)) {
28002 return PyInt_FromLong((
long) value);
28003 }
else if (
sizeof(
enum NPY_TYPES) <=
sizeof(
unsigned long)) {
28004 return PyLong_FromUnsignedLong((
unsigned long) value);
28005 #ifdef HAVE_LONG_LONG 28006 }
else if (
sizeof(
enum NPY_TYPES) <=
sizeof(
unsigned PY_LONG_LONG)) {
28007 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
28011 if (
sizeof(
enum NPY_TYPES) <=
sizeof(
long)) {
28012 return PyInt_FromLong((
long) value);
28013 #ifdef HAVE_LONG_LONG 28014 }
else if (
sizeof(
enum NPY_TYPES) <=
sizeof(PY_LONG_LONG)) {
28015 return PyLong_FromLongLong((PY_LONG_LONG) value);
28020 int one = 1;
int little = (int)*(
unsigned char *)&one;
28021 unsigned char *bytes = (
unsigned char *)&value;
28022 return _PyLong_FromByteArray(bytes,
sizeof(
enum NPY_TYPES),
28023 little, !is_unsigned);
28028 static __Pyx_memviewslice
28029 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
28030 const char *mode,
int ndim,
28031 size_t sizeof_dtype,
int contig_flag,
28032 int dtype_is_object)
28034 __Pyx_RefNannyDeclarations
28036 __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
28037 struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
28038 Py_buffer *buf = &from_memview->view;
28039 PyObject *shape_tuple = NULL;
28040 PyObject *temp_int = NULL;
28041 struct __pyx_array_obj *array_obj = NULL;
28042 struct __pyx_memoryview_obj *memview_obj = NULL;
28043 __Pyx_RefNannySetupContext(
"__pyx_memoryview_copy_new_contig", 0);
28044 for (i = 0; i < ndim; i++) {
28045 if (from_mvs->suboffsets[i] >= 0) {
28046 PyErr_Format(PyExc_ValueError,
"Cannot copy memoryview slice with " 28047 "indirect dimensions (axis %d)", i);
28051 shape_tuple = PyTuple_New(ndim);
28052 if (unlikely(!shape_tuple)) {
28055 __Pyx_GOTREF(shape_tuple);
28056 for(i = 0; i < ndim; i++) {
28057 temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
28058 if(unlikely(!temp_int)) {
28061 PyTuple_SET_ITEM(shape_tuple, i, temp_int);
28065 array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (
char *) mode, NULL);
28066 if (unlikely(!array_obj)) {
28069 __Pyx_GOTREF(array_obj);
28070 memview_obj = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
28071 (PyObject *) array_obj, contig_flag,
28073 from_mvs->memview->typeinfo);
28074 if (unlikely(!memview_obj))
28076 if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
28078 if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
28079 dtype_is_object) < 0))
28083 __Pyx_XDECREF(new_mvs.memview);
28084 new_mvs.memview = NULL;
28085 new_mvs.data = NULL;
28087 __Pyx_XDECREF(shape_tuple);
28088 __Pyx_XDECREF(temp_int);
28089 __Pyx_XDECREF(array_obj);
28090 __Pyx_RefNannyFinishContext();
28095 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
28096 const int neg_one = (int) ((
int) 0 - (int) 1), const_zero = (int) 0;
28097 const int is_unsigned = neg_one > const_zero;
28098 #if PY_MAJOR_VERSION < 3 28099 if (likely(PyInt_Check(x))) {
28100 if (
sizeof(
int) <
sizeof(long)) {
28101 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
28103 long val = PyInt_AS_LONG(x);
28104 if (is_unsigned && unlikely(val < 0)) {
28105 goto raise_neg_overflow;
28111 if (likely(PyLong_Check(x))) {
28113 #if CYTHON_USE_PYLONG_INTERNALS 28114 const digit* digits = ((PyLongObject*)x)->ob_digit;
28115 switch (Py_SIZE(x)) {
28116 case 0:
return (
int) 0;
28117 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
28119 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
28120 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28121 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28122 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
28123 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
28128 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
28129 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28130 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28131 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
28132 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
28137 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
28138 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28139 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28140 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
28141 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
28147 #if CYTHON_COMPILING_IN_CPYTHON 28148 if (unlikely(Py_SIZE(x) < 0)) {
28149 goto raise_neg_overflow;
28153 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28154 if (unlikely(result < 0))
28156 if (unlikely(result == 1))
28157 goto raise_neg_overflow;
28160 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
28161 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
28162 #ifdef HAVE_LONG_LONG 28163 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
28164 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28168 #if CYTHON_USE_PYLONG_INTERNALS 28169 const digit* digits = ((PyLongObject*)x)->ob_digit;
28170 switch (Py_SIZE(x)) {
28171 case 0:
return (
int) 0;
28172 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
28173 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
28175 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
28176 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28177 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28178 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
28179 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
28184 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
28185 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28186 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28187 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
28188 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
28193 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
28194 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28195 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28196 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
28197 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28202 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
28203 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28204 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28205 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
28206 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28211 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
28212 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28213 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28214 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
28215 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
28220 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
28221 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28222 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28223 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
28224 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
28230 if (
sizeof(
int) <=
sizeof(long)) {
28231 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
28232 #ifdef HAVE_LONG_LONG 28233 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
28234 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
28239 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) 28240 PyErr_SetString(PyExc_RuntimeError,
28241 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28244 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
28245 #if PY_MAJOR_VERSION < 3 28246 if (likely(v) && !PyLong_Check(v)) {
28248 v = PyNumber_Long(tmp);
28253 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
28254 unsigned char *bytes = (
unsigned char *)&val;
28255 int ret = _PyLong_AsByteArray((PyLongObject *)v,
28256 bytes,
sizeof(val),
28257 is_little, !is_unsigned);
28267 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28268 if (!tmp)
return (
int) -1;
28269 val = __Pyx_PyInt_As_int(tmp);
28274 PyErr_SetString(PyExc_OverflowError,
28275 "value too large to convert to int");
28277 raise_neg_overflow:
28278 PyErr_SetString(PyExc_OverflowError,
28279 "can't convert negative value to int");
28284 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
28285 const long neg_one = (long) ((
long) 0 - (long) 1), const_zero = (long) 0;
28286 const int is_unsigned = neg_one > const_zero;
28287 #if PY_MAJOR_VERSION < 3 28288 if (likely(PyInt_Check(x))) {
28289 if (
sizeof(
long) <
sizeof(long)) {
28290 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
28292 long val = PyInt_AS_LONG(x);
28293 if (is_unsigned && unlikely(val < 0)) {
28294 goto raise_neg_overflow;
28300 if (likely(PyLong_Check(x))) {
28302 #if CYTHON_USE_PYLONG_INTERNALS 28303 const digit* digits = ((PyLongObject*)x)->ob_digit;
28304 switch (Py_SIZE(x)) {
28305 case 0:
return (
long) 0;
28306 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
28308 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
28309 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28310 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28311 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
28312 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
28317 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
28318 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28319 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28320 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
28321 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28326 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
28327 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28328 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28329 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
28330 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
28336 #if CYTHON_COMPILING_IN_CPYTHON 28337 if (unlikely(Py_SIZE(x) < 0)) {
28338 goto raise_neg_overflow;
28342 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28343 if (unlikely(result < 0))
28345 if (unlikely(result == 1))
28346 goto raise_neg_overflow;
28349 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
28350 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
28351 #ifdef HAVE_LONG_LONG 28352 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
28353 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28357 #if CYTHON_USE_PYLONG_INTERNALS 28358 const digit* digits = ((PyLongObject*)x)->ob_digit;
28359 switch (Py_SIZE(x)) {
28360 case 0:
return (
long) 0;
28361 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
28362 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
28364 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
28365 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28366 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28367 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
28368 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28373 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
28374 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28375 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28376 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
28377 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28382 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
28383 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28384 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28385 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
28386 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28391 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
28392 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28393 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28394 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
28395 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28400 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
28401 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28402 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28403 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
28404 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28409 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
28410 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28411 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28412 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
28413 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28419 if (
sizeof(
long) <=
sizeof(long)) {
28420 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
28421 #ifdef HAVE_LONG_LONG 28422 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
28423 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
28428 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) 28429 PyErr_SetString(PyExc_RuntimeError,
28430 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28433 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
28434 #if PY_MAJOR_VERSION < 3 28435 if (likely(v) && !PyLong_Check(v)) {
28437 v = PyNumber_Long(tmp);
28442 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
28443 unsigned char *bytes = (
unsigned char *)&val;
28444 int ret = _PyLong_AsByteArray((PyLongObject *)v,
28445 bytes,
sizeof(val),
28446 is_little, !is_unsigned);
28456 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28457 if (!tmp)
return (
long) -1;
28458 val = __Pyx_PyInt_As_long(tmp);
28463 PyErr_SetString(PyExc_OverflowError,
28464 "value too large to convert to long");
28466 raise_neg_overflow:
28467 PyErr_SetString(PyExc_OverflowError,
28468 "can't convert negative value to long");
28473 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
28474 const long neg_one = (long) ((
long) 0 - (long) 1), const_zero = (long) 0;
28475 const int is_unsigned = neg_one > const_zero;
28477 if (
sizeof(
long) <
sizeof(long)) {
28478 return PyInt_FromLong((
long) value);
28479 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
28480 return PyLong_FromUnsignedLong((
unsigned long) value);
28481 #ifdef HAVE_LONG_LONG 28482 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
28483 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
28487 if (
sizeof(
long) <=
sizeof(
long)) {
28488 return PyInt_FromLong((
long) value);
28489 #ifdef HAVE_LONG_LONG 28490 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
28491 return PyLong_FromLongLong((PY_LONG_LONG) value);
28496 int one = 1;
int little = (int)*(
unsigned char *)&one;
28497 unsigned char *bytes = (
unsigned char *)&value;
28498 return _PyLong_FromByteArray(bytes,
sizeof(
long),
28499 little, !is_unsigned);
28504 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *x) {
28505 const char neg_one = (char) ((
char) 0 - (char) 1), const_zero = (char) 0;
28506 const int is_unsigned = neg_one > const_zero;
28507 #if PY_MAJOR_VERSION < 3 28508 if (likely(PyInt_Check(x))) {
28509 if (
sizeof(
char) <
sizeof(long)) {
28510 __PYX_VERIFY_RETURN_INT(
char,
long, PyInt_AS_LONG(x))
28512 long val = PyInt_AS_LONG(x);
28513 if (is_unsigned && unlikely(val < 0)) {
28514 goto raise_neg_overflow;
28520 if (likely(PyLong_Check(x))) {
28522 #if CYTHON_USE_PYLONG_INTERNALS 28523 const digit* digits = ((PyLongObject*)x)->ob_digit;
28524 switch (Py_SIZE(x)) {
28525 case 0:
return (
char) 0;
28526 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, digits[0])
28528 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
28529 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28530 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28531 }
else if (8 *
sizeof(
char) >= 2 * PyLong_SHIFT) {
28532 return (
char) (((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
28537 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
28538 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28539 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28540 }
else if (8 *
sizeof(
char) >= 3 * PyLong_SHIFT) {
28541 return (
char) (((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28546 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
28547 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28548 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28549 }
else if (8 *
sizeof(
char) >= 4 * PyLong_SHIFT) {
28550 return (
char) (((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
28556 #if CYTHON_COMPILING_IN_CPYTHON 28557 if (unlikely(Py_SIZE(x) < 0)) {
28558 goto raise_neg_overflow;
28562 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28563 if (unlikely(result < 0))
28565 if (unlikely(result == 1))
28566 goto raise_neg_overflow;
28569 if (
sizeof(
char) <=
sizeof(
unsigned long)) {
28570 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned long, PyLong_AsUnsignedLong(x))
28571 #ifdef HAVE_LONG_LONG 28572 }
else if (
sizeof(
char) <=
sizeof(
unsigned PY_LONG_LONG)) {
28573 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28577 #if CYTHON_USE_PYLONG_INTERNALS 28578 const digit* digits = ((PyLongObject*)x)->ob_digit;
28579 switch (Py_SIZE(x)) {
28580 case 0:
return (
char) 0;
28581 case -1: __PYX_VERIFY_RETURN_INT(
char, sdigit, (sdigit) (-(sdigit)digits[0]))
28582 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, +digits[0])
28584 if (8 *
sizeof(
char) - 1 > 1 * PyLong_SHIFT) {
28585 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28586 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28587 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
28588 return (
char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
28593 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
28594 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28595 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28596 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
28597 return (
char) ((((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
28602 if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
28603 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28604 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28605 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
28606 return (
char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28611 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
28612 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28613 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28614 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
28615 return (
char) ((((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28620 if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
28621 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28622 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28623 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
28624 return (
char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
28629 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
28630 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28631 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28632 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
28633 return (
char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
28639 if (
sizeof(
char) <=
sizeof(long)) {
28640 __PYX_VERIFY_RETURN_INT_EXC(
char,
long, PyLong_AsLong(x))
28641 #ifdef HAVE_LONG_LONG 28642 }
else if (
sizeof(
char) <=
sizeof(PY_LONG_LONG)) {
28643 __PYX_VERIFY_RETURN_INT_EXC(
char, PY_LONG_LONG, PyLong_AsLongLong(x))
28648 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) 28649 PyErr_SetString(PyExc_RuntimeError,
28650 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28653 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
28654 #if PY_MAJOR_VERSION < 3 28655 if (likely(v) && !PyLong_Check(v)) {
28657 v = PyNumber_Long(tmp);
28662 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
28663 unsigned char *bytes = (
unsigned char *)&val;
28664 int ret = _PyLong_AsByteArray((PyLongObject *)v,
28665 bytes,
sizeof(val),
28666 is_little, !is_unsigned);
28676 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28677 if (!tmp)
return (
char) -1;
28678 val = __Pyx_PyInt_As_char(tmp);
28683 PyErr_SetString(PyExc_OverflowError,
28684 "value too large to convert to char");
28686 raise_neg_overflow:
28687 PyErr_SetString(PyExc_OverflowError,
28688 "can't convert negative value to char");
28693 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void)
28699 S.u32 = 0x01020304;
28700 return S.u8[0] == 4;
28704 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
28705 __Pyx_BufFmt_StackElem* stack,
28706 __Pyx_TypeInfo* type) {
28707 stack[0].field = &ctx->root;
28708 stack[0].parent_offset = 0;
28709 ctx->root.type = type;
28710 ctx->root.name =
"buffer dtype";
28711 ctx->root.offset = 0;
28713 ctx->head->field = &ctx->root;
28714 ctx->fmt_offset = 0;
28715 ctx->head->parent_offset = 0;
28716 ctx->new_packmode =
'@';
28717 ctx->enc_packmode =
'@';
28718 ctx->new_count = 1;
28719 ctx->enc_count = 0;
28721 ctx->is_complex = 0;
28722 ctx->is_valid_array = 0;
28723 ctx->struct_alignment = 0;
28724 while (type->typegroup ==
'S') {
28726 ctx->head->field = type->fields;
28727 ctx->head->parent_offset = 0;
28728 type = type->fields->type;
28731 static int __Pyx_BufFmt_ParseNumber(
const char** ts) {
28733 const char* t = *ts;
28734 if (*t < '0' || *t >
'9') {
28737 count = *t++ -
'0';
28738 while (*t >=
'0' && *t <=
'9') {
28740 count += *t++ -
'0';
28746 static int __Pyx_BufFmt_ExpectNumber(
const char **ts) {
28747 int number = __Pyx_BufFmt_ParseNumber(ts);
28749 PyErr_Format(PyExc_ValueError,\
28750 "Does not understand character buffer dtype format string ('%c')", **ts);
28753 static void __Pyx_BufFmt_RaiseUnexpectedChar(
char ch) {
28754 PyErr_Format(PyExc_ValueError,
28755 "Unexpected format string character: '%c'", ch);
28757 static const char* __Pyx_BufFmt_DescribeTypeChar(
char ch,
int is_complex) {
28759 case '?':
return "'bool'";
28760 case 'c':
return "'char'";
28761 case 'b':
return "'signed char'";
28762 case 'B':
return "'unsigned char'";
28763 case 'h':
return "'short'";
28764 case 'H':
return "'unsigned short'";
28765 case 'i':
return "'int'";
28766 case 'I':
return "'unsigned int'";
28767 case 'l':
return "'long'";
28768 case 'L':
return "'unsigned long'";
28769 case 'q':
return "'long long'";
28770 case 'Q':
return "'unsigned long long'";
28771 case 'f':
return (is_complex ?
"'complex float'" :
"'float'");
28772 case 'd':
return (is_complex ?
"'complex double'" :
"'double'");
28773 case 'g':
return (is_complex ?
"'complex long double'" :
"'long double'");
28774 case 'T':
return "a struct";
28775 case 'O':
return "Python object";
28776 case 'P':
return "a pointer";
28777 case 's':
case 'p':
return "a string";
28778 case 0:
return "end";
28779 default:
return "unparseable format string";
28782 static size_t __Pyx_BufFmt_TypeCharToStandardSize(
char ch,
int is_complex) {
28784 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
28785 case 'h':
case 'H':
return 2;
28786 case 'i':
case 'I':
case 'l':
case 'L':
return 4;
28787 case 'q':
case 'Q':
return 8;
28788 case 'f':
return (is_complex ? 8 : 4);
28789 case 'd':
return (is_complex ? 16 : 8);
28791 PyErr_SetString(PyExc_ValueError,
"Python does not define a standard format string size for long double ('g')..");
28794 case 'O':
case 'P':
return sizeof(
void*);
28796 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
28800 static size_t __Pyx_BufFmt_TypeCharToNativeSize(
char ch,
int is_complex) {
28802 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
28803 case 'h':
case 'H':
return sizeof(short);
28804 case 'i':
case 'I':
return sizeof(int);
28805 case 'l':
case 'L':
return sizeof(long);
28806 #ifdef HAVE_LONG_LONG 28807 case 'q':
case 'Q':
return sizeof(PY_LONG_LONG);
28809 case 'f':
return sizeof(float) * (is_complex ? 2 : 1);
28810 case 'd':
return sizeof(double) * (is_complex ? 2 : 1);
28811 case 'g':
return sizeof(
long double) * (is_complex ? 2 : 1);
28812 case 'O':
case 'P':
return sizeof(
void*);
28814 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
28819 typedef struct {
char c;
short x; } __Pyx_st_short;
28820 typedef struct {
char c;
int x; } __Pyx_st_int;
28821 typedef struct {
char c;
long x; } __Pyx_st_long;
28822 typedef struct {
char c;
float x; } __Pyx_st_float;
28823 typedef struct {
char c;
double x; } __Pyx_st_double;
28824 typedef struct {
char c;
long double x; } __Pyx_st_longdouble;
28825 typedef struct {
char c;
void *x; } __Pyx_st_void_p;
28826 #ifdef HAVE_LONG_LONG 28827 typedef struct {
char c; PY_LONG_LONG x; } __Pyx_st_longlong;
28829 static size_t __Pyx_BufFmt_TypeCharToAlignment(
char ch, CYTHON_UNUSED
int is_complex) {
28831 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
28832 case 'h':
case 'H':
return sizeof(__Pyx_st_short) -
sizeof(
short);
28833 case 'i':
case 'I':
return sizeof(__Pyx_st_int) -
sizeof(
int);
28834 case 'l':
case 'L':
return sizeof(__Pyx_st_long) -
sizeof(
long);
28835 #ifdef HAVE_LONG_LONG 28836 case 'q':
case 'Q':
return sizeof(__Pyx_st_longlong) -
sizeof(PY_LONG_LONG);
28838 case 'f':
return sizeof(__Pyx_st_float) -
sizeof(
float);
28839 case 'd':
return sizeof(__Pyx_st_double) -
sizeof(
double);
28840 case 'g':
return sizeof(__Pyx_st_longdouble) -
sizeof(
long double);
28841 case 'P':
case 'O':
return sizeof(__Pyx_st_void_p) -
sizeof(
void*);
28843 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
28851 typedef struct {
short x;
char c; } __Pyx_pad_short;
28852 typedef struct {
int x;
char c; } __Pyx_pad_int;
28853 typedef struct {
long x;
char c; } __Pyx_pad_long;
28854 typedef struct {
float x;
char c; } __Pyx_pad_float;
28855 typedef struct {
double x;
char c; } __Pyx_pad_double;
28856 typedef struct {
long double x;
char c; } __Pyx_pad_longdouble;
28857 typedef struct {
void *x;
char c; } __Pyx_pad_void_p;
28858 #ifdef HAVE_LONG_LONG 28859 typedef struct { PY_LONG_LONG x;
char c; } __Pyx_pad_longlong;
28861 static size_t __Pyx_BufFmt_TypeCharToPadding(
char ch, CYTHON_UNUSED
int is_complex) {
28863 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
28864 case 'h':
case 'H':
return sizeof(__Pyx_pad_short) -
sizeof(
short);
28865 case 'i':
case 'I':
return sizeof(__Pyx_pad_int) -
sizeof(
int);
28866 case 'l':
case 'L':
return sizeof(__Pyx_pad_long) -
sizeof(
long);
28867 #ifdef HAVE_LONG_LONG 28868 case 'q':
case 'Q':
return sizeof(__Pyx_pad_longlong) -
sizeof(PY_LONG_LONG);
28870 case 'f':
return sizeof(__Pyx_pad_float) -
sizeof(
float);
28871 case 'd':
return sizeof(__Pyx_pad_double) -
sizeof(
double);
28872 case 'g':
return sizeof(__Pyx_pad_longdouble) -
sizeof(
long double);
28873 case 'P':
case 'O':
return sizeof(__Pyx_pad_void_p) -
sizeof(
void*);
28875 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
28879 static char __Pyx_BufFmt_TypeCharToGroup(
char ch,
int is_complex) {
28883 case 'b':
case 'h':
case 'i':
28884 case 'l':
case 'q':
case 's':
case 'p':
28886 case '?':
case 'B':
case 'H':
case 'I':
case 'L':
case 'Q':
28888 case 'f':
case 'd':
case 'g':
28889 return (is_complex ?
'C' :
'R');
28895 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
28900 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
28901 if (ctx->head == NULL || ctx->head->field == &ctx->root) {
28902 const char* expected;
28904 if (ctx->head == NULL) {
28908 expected = ctx->head->field->type->name;
28911 PyErr_Format(PyExc_ValueError,
28912 "Buffer dtype mismatch, expected %s%s%s but got %s",
28913 quote, expected, quote,
28914 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
28916 __Pyx_StructField* field = ctx->head->field;
28917 __Pyx_StructField* parent = (ctx->head - 1)->field;
28918 PyErr_Format(PyExc_ValueError,
28919 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
28920 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
28921 parent->type->name, field->name);
28924 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
28926 size_t size, offset, arraysize = 1;
28927 if (ctx->enc_type == 0)
return 0;
28928 if (ctx->head->field->type->arraysize[0]) {
28930 if (ctx->enc_type ==
's' || ctx->enc_type ==
'p') {
28931 ctx->is_valid_array = ctx->head->field->type->ndim == 1;
28933 if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
28934 PyErr_Format(PyExc_ValueError,
28935 "Expected a dimension of size %zu, got %zu",
28936 ctx->head->field->type->arraysize[0], ctx->enc_count);
28940 if (!ctx->is_valid_array) {
28941 PyErr_Format(PyExc_ValueError,
"Expected %d dimensions, got %d",
28942 ctx->head->field->type->ndim, ndim);
28945 for (i = 0; i < ctx->head->field->type->ndim; i++) {
28946 arraysize *= ctx->head->field->type->arraysize[i];
28948 ctx->is_valid_array = 0;
28949 ctx->enc_count = 1;
28951 group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
28953 __Pyx_StructField* field = ctx->head->field;
28954 __Pyx_TypeInfo* type = field->type;
28955 if (ctx->enc_packmode ==
'@' || ctx->enc_packmode ==
'^') {
28956 size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
28958 size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
28960 if (ctx->enc_packmode ==
'@') {
28961 size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
28962 size_t align_mod_offset;
28963 if (align_at == 0)
return -1;
28964 align_mod_offset = ctx->fmt_offset % align_at;
28965 if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
28966 if (ctx->struct_alignment == 0)
28967 ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
28970 if (type->size != size || type->typegroup != group) {
28971 if (type->typegroup ==
'C' && type->fields != NULL) {
28972 size_t parent_offset = ctx->head->parent_offset + field->offset;
28974 ctx->head->field = type->fields;
28975 ctx->head->parent_offset = parent_offset;
28978 if ((type->typegroup ==
'H' || group ==
'H') && type->size == size) {
28980 __Pyx_BufFmt_RaiseExpected(ctx);
28984 offset = ctx->head->parent_offset + field->offset;
28985 if (ctx->fmt_offset != offset) {
28986 PyErr_Format(PyExc_ValueError,
28987 "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T
"d but %" CYTHON_FORMAT_SSIZE_T
"d expected",
28988 (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
28991 ctx->fmt_offset += size;
28993 ctx->fmt_offset += (arraysize - 1) * size;
28996 if (field == &ctx->root) {
28998 if (ctx->enc_count != 0) {
28999 __Pyx_BufFmt_RaiseExpected(ctx);
29004 ctx->head->field = ++field;
29005 if (field->type == NULL) {
29007 field = ctx->head->field;
29009 }
else if (field->type->typegroup ==
'S') {
29010 size_t parent_offset = ctx->head->parent_offset + field->offset;
29011 if (field->type->fields->type == NULL)
continue;
29012 field = field->type->fields;
29014 ctx->head->field = field;
29015 ctx->head->parent_offset = parent_offset;
29021 }
while (ctx->enc_count);
29023 ctx->is_complex = 0;
29027 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx,
const char** tsp)
29029 const char *ts = *tsp;
29031 int ndim = ctx->head->field->type->ndim;
29034 if (ctx->new_count != 1) {
29035 PyErr_SetString(PyExc_ValueError,
29036 "Cannot handle repeated arrays in format string");
29039 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
29040 while (*ts && *ts !=
')') {
29042 case ' ':
case '\f':
case '\r':
case '\n':
case '\t':
case '\v':
continue;
29045 number = __Pyx_BufFmt_ExpectNumber(&ts);
29046 if (
number == -1)
return NULL;
29047 if (i < ndim && (
size_t)
number != ctx->head->field->type->arraysize[i])
29048 return PyErr_Format(PyExc_ValueError,
29049 "Expected a dimension of size %zu, got %d",
29050 ctx->head->field->type->arraysize[i],
number);
29051 if (*ts !=
',' && *ts !=
')')
29052 return PyErr_Format(PyExc_ValueError,
29053 "Expected a comma in format string, got '%c'", *ts);
29054 if (*ts ==
',') ts++;
29058 return PyErr_Format(PyExc_ValueError,
"Expected %d dimension(s), got %d",
29059 ctx->head->field->type->ndim, i);
29061 PyErr_SetString(PyExc_ValueError,
29062 "Unexpected end of format string, expected ')'");
29065 ctx->is_valid_array = 1;
29066 ctx->new_count = 1;
29070 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts) {
29075 if (ctx->enc_type != 0 && ctx->head == NULL) {
29076 __Pyx_BufFmt_RaiseExpected(ctx);
29079 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
29080 if (ctx->head != NULL) {
29081 __Pyx_BufFmt_RaiseExpected(ctx);
29091 if (!__Pyx_Is_Little_Endian()) {
29092 PyErr_SetString(PyExc_ValueError,
"Little-endian buffer not supported on big-endian compiler");
29095 ctx->new_packmode =
'=';
29100 if (__Pyx_Is_Little_Endian()) {
29101 PyErr_SetString(PyExc_ValueError,
"Big-endian buffer not supported on little-endian compiler");
29104 ctx->new_packmode =
'=';
29110 ctx->new_packmode = *ts++;
29114 const char* ts_after_sub;
29115 size_t i, struct_count = ctx->new_count;
29116 size_t struct_alignment = ctx->struct_alignment;
29117 ctx->new_count = 1;
29120 PyErr_SetString(PyExc_ValueError,
"Buffer acquisition: Expected '{' after 'T'");
29123 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
29125 ctx->enc_count = 0;
29126 ctx->struct_alignment = 0;
29129 for (i = 0; i != struct_count; ++i) {
29130 ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
29131 if (!ts_after_sub)
return NULL;
29134 if (struct_alignment) ctx->struct_alignment = struct_alignment;
29139 size_t alignment = ctx->struct_alignment;
29141 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
29143 if (alignment && ctx->fmt_offset % alignment) {
29144 ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
29149 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
29150 ctx->fmt_offset += ctx->new_count;
29151 ctx->new_count = 1;
29152 ctx->enc_count = 0;
29154 ctx->enc_packmode = ctx->new_packmode;
29160 if (*ts !=
'f' && *ts !=
'd' && *ts !=
'g') {
29161 __Pyx_BufFmt_RaiseUnexpectedChar(
'Z');
29164 CYTHON_FALLTHROUGH;
29165 case '?':
case 'c':
case 'b':
case 'B':
case 'h':
case 'H':
case 'i':
case 'I':
29166 case 'l':
case 'L':
case 'q':
case 'Q':
29167 case 'f':
case 'd':
case 'g':
29168 case 'O':
case 'p':
29169 if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
29170 ctx->enc_packmode == ctx->new_packmode) {
29171 ctx->enc_count += ctx->new_count;
29172 ctx->new_count = 1;
29177 CYTHON_FALLTHROUGH;
29179 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
29180 ctx->enc_count = ctx->new_count;
29181 ctx->enc_packmode = ctx->new_packmode;
29182 ctx->enc_type = *ts;
29183 ctx->is_complex = got_Z;
29185 ctx->new_count = 1;
29190 while(*ts !=
':') ++ts;
29194 if (!__pyx_buffmt_parse_array(ctx, &ts))
return NULL;
29198 int number = __Pyx_BufFmt_ExpectNumber(&ts);
29199 if (number == -1)
return NULL;
29200 ctx->new_count = (size_t)number;
29208 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
29215 if (a->size != b->size || a->typegroup != b->typegroup ||
29216 a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
29217 if (a->typegroup ==
'H' || b->typegroup ==
'H') {
29218 return a->size == b->size;
29224 for (i = 0; i < a->ndim; i++)
29225 if (a->arraysize[i] != b->arraysize[i])
29228 if (a->typegroup ==
'S') {
29229 if (a->flags != b->flags)
29231 if (a->fields || b->fields) {
29232 if (!(a->fields && b->fields))
29234 for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
29235 __Pyx_StructField *field_a = a->fields + i;
29236 __Pyx_StructField *field_b = b->fields + i;
29237 if (field_a->offset != field_b->offset ||
29238 !__pyx_typeinfo_cmp(field_a->type, field_b->type))
29241 return !a->fields[i].type && !b->fields[i].type;
29249 __pyx_check_strides(Py_buffer *buf,
int dim,
int ndim,
int spec)
29251 if (buf->shape[dim] <= 1)
29253 if (buf->strides) {
29254 if (spec & __Pyx_MEMVIEW_CONTIG) {
29255 if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
29256 if (buf->strides[dim] !=
sizeof(
void *)) {
29257 PyErr_Format(PyExc_ValueError,
29258 "Buffer is not indirectly contiguous " 29259 "in dimension %d.", dim);
29262 }
else if (buf->strides[dim] != buf->itemsize) {
29263 PyErr_SetString(PyExc_ValueError,
29264 "Buffer and memoryview are not contiguous " 29265 "in the same dimension.");
29269 if (spec & __Pyx_MEMVIEW_FOLLOW) {
29270 Py_ssize_t stride = buf->strides[dim];
29273 if (stride < buf->itemsize) {
29274 PyErr_SetString(PyExc_ValueError,
29275 "Buffer and memoryview are not contiguous " 29276 "in the same dimension.");
29281 if (spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1) {
29282 PyErr_Format(PyExc_ValueError,
29283 "C-contiguous buffer is not contiguous in " 29284 "dimension %d", dim);
29286 }
else if (spec & (__Pyx_MEMVIEW_PTR)) {
29287 PyErr_Format(PyExc_ValueError,
29288 "C-contiguous buffer is not indirect in " 29289 "dimension %d", dim);
29291 }
else if (buf->suboffsets) {
29292 PyErr_SetString(PyExc_ValueError,
29293 "Buffer exposes suboffsets but no strides");
29302 __pyx_check_suboffsets(Py_buffer *buf,
int dim, CYTHON_UNUSED
int ndim,
int spec)
29304 if (spec & __Pyx_MEMVIEW_DIRECT) {
29305 if (buf->suboffsets && buf->suboffsets[dim] >= 0) {
29306 PyErr_Format(PyExc_ValueError,
29307 "Buffer not compatible with direct access " 29308 "in dimension %d.", dim);
29312 if (spec & __Pyx_MEMVIEW_PTR) {
29313 if (!buf->suboffsets || (buf->suboffsets[dim] < 0)) {
29314 PyErr_Format(PyExc_ValueError,
29315 "Buffer is not indirectly accessible " 29316 "in dimension %d.", dim);
29325 __pyx_verify_contig(Py_buffer *buf,
int ndim,
int c_or_f_flag)
29328 if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
29329 Py_ssize_t stride = 1;
29330 for (i = 0; i < ndim; i++) {
29331 if (stride * buf->itemsize != buf->strides[i] &&
29334 PyErr_SetString(PyExc_ValueError,
29335 "Buffer not fortran contiguous.");
29338 stride = stride * buf->shape[i];
29340 }
else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
29341 Py_ssize_t stride = 1;
29342 for (i = ndim - 1; i >- 1; i--) {
29343 if (stride * buf->itemsize != buf->strides[i] &&
29344 buf->shape[i] > 1) {
29345 PyErr_SetString(PyExc_ValueError,
29346 "Buffer not C contiguous.");
29349 stride = stride * buf->shape[i];
29356 static int __Pyx_ValidateAndInit_memviewslice(
29361 __Pyx_TypeInfo *dtype,
29362 __Pyx_BufFmt_StackElem stack[],
29363 __Pyx_memviewslice *memviewslice,
29364 PyObject *original_obj)
29366 struct __pyx_memoryview_obj *memview, *new_memview;
29367 __Pyx_RefNannyDeclarations
29369 int i, spec = 0, retval = -1;
29370 __Pyx_BufFmt_Context ctx;
29371 int from_memoryview = __pyx_memoryview_check(original_obj);
29372 __Pyx_RefNannySetupContext(
"ValidateAndInit_memviewslice", 0);
29373 if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((
struct __pyx_memoryview_obj *)
29374 original_obj)->typeinfo)) {
29375 memview = (
struct __pyx_memoryview_obj *) original_obj;
29376 new_memview = NULL;
29378 memview = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
29379 original_obj, buf_flags, 0, dtype);
29380 new_memview = memview;
29381 if (unlikely(!memview))
29384 buf = &memview->view;
29385 if (buf->ndim != ndim) {
29386 PyErr_Format(PyExc_ValueError,
29387 "Buffer has wrong number of dimensions (expected %d, got %d)",
29392 __Pyx_BufFmt_Init(&ctx, stack, dtype);
29393 if (!__Pyx_BufFmt_CheckString(&ctx, buf->format))
goto fail;
29395 if ((
unsigned) buf->itemsize != dtype->size) {
29396 PyErr_Format(PyExc_ValueError,
29397 "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T
"u byte%s) " 29398 "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T
"u byte%s)",
29400 (buf->itemsize > 1) ?
"s" :
"",
29403 (dtype->size > 1) ?
"s" :
"");
29406 for (i = 0; i < ndim; i++) {
29407 spec = axes_specs[i];
29408 if (!__pyx_check_strides(buf, i, ndim, spec))
29410 if (!__pyx_check_suboffsets(buf, i, ndim, spec))
29413 if (buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag))
29415 if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
29416 new_memview != NULL) == -1)) {
29422 Py_XDECREF(new_memview);
29425 __Pyx_RefNannyFinishContext();
29430 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj,
int writable_flag) {
29431 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
29432 __Pyx_BufFmt_StackElem stack[1];
29433 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
29435 if (obj == Py_None) {
29436 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
29439 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
29440 PyBUF_RECORDS_RO | writable_flag, 1,
29441 &__Pyx_TypeInfo_double, stack,
29443 if (unlikely(retcode == -1))
29447 result.memview = NULL;
29448 result.data = NULL;
29453 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *obj,
int writable_flag) {
29454 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
29455 __Pyx_BufFmt_StackElem stack[1];
29456 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
29458 if (obj == Py_None) {
29459 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
29462 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
29463 PyBUF_RECORDS_RO | writable_flag, 1,
29464 &__Pyx_TypeInfo_int, stack,
29466 if (unlikely(retcode == -1))
29470 result.memview = NULL;
29471 result.data = NULL;
29476 static int __Pyx_check_binary_version(
void) {
29477 char ctversion[4], rtversion[4];
29478 PyOS_snprintf(ctversion, 4,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
29479 PyOS_snprintf(rtversion, 4,
"%s", Py_GetVersion());
29480 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
29482 PyOS_snprintf(message,
sizeof(message),
29483 "compiletime version %s of module '%.100s' " 29484 "does not match runtime version %s",
29485 ctversion, __Pyx_MODULE_NAME, rtversion);
29486 return PyErr_WarnEx(NULL, message, 1);
29492 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
29494 #if PY_MAJOR_VERSION < 3 29495 if (t->is_unicode) {
29496 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
29497 }
else if (t->intern) {
29498 *t->p = PyString_InternFromString(t->s);
29500 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
29503 if (t->is_unicode | t->is_str) {
29505 *t->p = PyUnicode_InternFromString(t->s);
29506 }
else if (t->encoding) {
29507 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
29509 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
29512 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
29517 if (PyObject_Hash(*t->p) == -1)
29524 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
29525 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
29527 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
29529 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
29531 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 29532 #if !CYTHON_PEP393_ENABLED 29533 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29535 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
29536 if (!defenc)
return NULL;
29537 defenc_c = PyBytes_AS_STRING(defenc);
29538 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 29540 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
29542 for (c = defenc_c; c < end; c++) {
29543 if ((
unsigned char) (*c) >= 128) {
29544 PyUnicode_AsASCIIString(o);
29550 *length = PyBytes_GET_SIZE(defenc);
29554 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29555 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
29556 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 29557 if (likely(PyUnicode_IS_ASCII(o))) {
29558 *length = PyUnicode_GET_LENGTH(o);
29559 return PyUnicode_AsUTF8(o);
29561 PyUnicode_AsASCIIString(o);
29565 return PyUnicode_AsUTF8AndSize(o, length);
29570 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29571 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 29573 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29574 __Pyx_sys_getdefaultencoding_not_ascii &&
29576 PyUnicode_Check(o)) {
29577 return __Pyx_PyUnicode_AsStringAndSize(o, length);
29580 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) 29581 if (PyByteArray_Check(o)) {
29582 *length = PyByteArray_GET_SIZE(o);
29583 return PyByteArray_AS_STRING(o);
29588 int r = PyBytes_AsStringAndSize(o, &result, length);
29589 if (unlikely(r < 0)) {
29596 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
29597 int is_true = x == Py_True;
29598 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
29599 else return PyObject_IsTrue(x);
29601 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
29603 if (unlikely(!x))
return -1;
29604 retval = __Pyx_PyObject_IsTrue(x);
29608 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
29609 #if PY_MAJOR_VERSION >= 3 29610 if (PyLong_Check(result)) {
29611 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
29612 "__int__ returned non-int (type %.200s). " 29613 "The ability to return an instance of a strict subclass of int " 29614 "is deprecated, and may be removed in a future version of Python.",
29615 Py_TYPE(result)->tp_name)) {
29622 PyErr_Format(PyExc_TypeError,
29623 "__%.4s__ returned non-%.4s (type %.200s)",
29624 type_name, type_name, Py_TYPE(result)->tp_name);
29628 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
29629 #if CYTHON_USE_TYPE_SLOTS 29630 PyNumberMethods *m;
29632 const char *name = NULL;
29633 PyObject *res = NULL;
29634 #if PY_MAJOR_VERSION < 3 29635 if (likely(PyInt_Check(x) || PyLong_Check(x)))
29637 if (likely(PyLong_Check(x)))
29639 return __Pyx_NewRef(x);
29640 #if CYTHON_USE_TYPE_SLOTS 29641 m = Py_TYPE(x)->tp_as_number;
29642 #if PY_MAJOR_VERSION < 3 29643 if (m && m->nb_int) {
29645 res = m->nb_int(x);
29647 else if (m && m->nb_long) {
29649 res = m->nb_long(x);
29652 if (likely(m && m->nb_int)) {
29654 res = m->nb_int(x);
29658 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
29659 res = PyNumber_Int(x);
29663 #if PY_MAJOR_VERSION < 3 29664 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
29666 if (unlikely(!PyLong_CheckExact(res))) {
29668 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
29671 else if (!PyErr_Occurred()) {
29672 PyErr_SetString(PyExc_TypeError,
29673 "an integer is required");
29677 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
29680 #if PY_MAJOR_VERSION < 3 29681 if (likely(PyInt_CheckExact(b))) {
29682 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
29683 return PyInt_AS_LONG(b);
29685 return PyInt_AsSsize_t(b);
29688 if (likely(PyLong_CheckExact(b))) {
29689 #if CYTHON_USE_PYLONG_INTERNALS 29690 const digit* digits = ((PyLongObject*)b)->ob_digit;
29691 const Py_ssize_t size = Py_SIZE(b);
29692 if (likely(__Pyx_sst_abs(size) <= 1)) {
29693 ival = likely(size) ? digits[0] : 0;
29694 if (size == -1) ival = -ival;
29699 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
29700 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
29704 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
29705 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29709 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
29710 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29714 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
29715 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
29719 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
29720 return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
29724 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
29725 return -(Py_ssize_t) (((((((((
size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29731 return PyLong_AsSsize_t(b);
29733 x = PyNumber_Index(b);
29735 ival = PyInt_AsSsize_t(x);
29739 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
29740 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
29742 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
29743 return PyInt_FromSize_t(ival);
void gauss_seidel_NR_solve(SuperMatrix *A, double *M, double *R, int *node_order, double *dX)
void gauss_seidel_NR_prepare(SuperMatrix *A, double w, double tol, double *M)
int basm_NR_init(int rowBlocks, SuperMatrix *A, int **subdomain_dim_p, int ***l2g_L_p, double ***subdomain_L_p, double ***subdomain_R_p, double ***subdomain_dX_p, PROTEUS_LAPACK_INTEGER ***subdomain_pivots_p, PROTEUS_LAPACK_INTEGER ***subdomain_col_pivots_p)
void jacobi_NR_solve(SuperMatrix *A, double *M, double *R, int *node_order, double *dX)
void asm_NR_prepare(SuperMatrix *A, int *subdomain_dim, int **l2g_L, double **subdomainL, PROTEUS_LAPACK_INTEGER **subdomainPivots)
int asm_NR_init(SuperMatrix *A, int **subdomain_dim_p, int ***l2g_L_p, double ***subdomain_L_p, double ***subdomain_R_p, double ***subdomain_dX_p, PROTEUS_LAPACK_INTEGER ***subdomain_pivots_p)
void basm_NR_prepare(int rowBlocks, int N, SuperMatrix *A, int *subdomain_dim, int **l2g_L, double **subdomainL, PROTEUS_LAPACK_INTEGER **subdomainPivots, PROTEUS_LAPACK_INTEGER **subdomainColPivots)
void nl_gauss_seidel_NR_solve(SuperMatrix *A, double *R, int *node_order, double w, double tol, double *dX)
void asm_NR_free(int N, int *subdomain_dim, int **l2g_L, double **subdomain_L, double **subdomain_R, double **subdomain_dX, PROTEUS_LAPACK_INTEGER **subdomain_pivots)
void nl_jacobi_NR_solve(SuperMatrix *A, double *R, int *node_order, double w, double tol, double *dX)
void jacobi_NR_prepare(SuperMatrix *A, double w, double tol, double *M)
C implementations of multilevel smoother algorithms.
void asm_NR_solve(SuperMatrix *A, double w, double **subdomainL, int *subdomain_dim, int **l2g_L, double *R, double **subdomainR, int *node_order, double **subdomain_dX, double *dX, PROTEUS_LAPACK_INTEGER **subdomainPivots)
void basm_NR_solve(int rowBlocks, int N, SuperMatrix *A, double w, double **subdomainL, int *subdomain_dim, int **l2g_L, double *R, double **subdomainR, int *node_order, double **subdomain_dX, double *dX, PROTEUS_LAPACK_INTEGER **subdomainPivots, PROTEUS_LAPACK_INTEGER **subdomainColPivots)
void basm_NR_free(int N, int *subdomain_dim, int **l2g_L, double **subdomain_L, double **subdomain_R, double **subdomain_dX, PROTEUS_LAPACK_INTEGER **subdomain_pivots, PROTEUS_LAPACK_INTEGER **subdomain_col_pivots)